Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuki 4th Gen Pro MQTT Entity does not get recognized as a valid Alarmo sensor #1106

Closed
2 tasks done
dejanpan opened this issue Jan 22, 2025 · 3 comments
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@dejanpan
Copy link

Checklist

  • I am using the latest version of Alarmo (latest version can be found here)
  • I checked for similar existing requests (both open and closed) before posting.

Alarmo Version

v1.10.7

HA Version

2024.12

Bug description

Hi and big thanks for this really awesome project!!!

According to the docs, the entities of type Lock should be supported as a sensor: https://github.com/nielsfaber/alarmo?tab=readme-ov-file#sensor-types.

I have Nuki 4th Gen Pro MQTT Entity does not get recognized as a valid Alarmo sensor:

Image

It seems to me that the sensor entity validation happens here:

if (services.length == 1 && services[0]?.includes('lock'))
state = this.hass.localize('component.lock.state._.locked');
if (services.length == 1 && services[0]?.includes('unlock'))
state = this.hass.localize('component.lock.state._.unlocked');
but I am not very familiar with this code.

I for now did this workaround but it would be better if Nuki Lock would get recognized directly by alarmo.

Steps to reproduce

See above.

Relevant log output

@dejanpan dejanpan added the bug Something isn't working label Jan 22, 2025
@nielsfaber
Copy link
Owner

Alarmo only supports binary_sensor entities as also is clearly mentioned in the documentation.
So creating a template sensor based on the state of your lock entity is an OK solution.
Given that this is not a bug, I’m closing this.

@dejanpan
Copy link
Author

Alarmo only supports binary_sensor entities as also is clearly mentioned in the documentation. So creating a template sensor based on the state of your lock entity is an OK solution. Given that this is not a bug, I’m closing this.

Thanks @nielsfaber. I needed to today draw a picture to understand again what Device, Entity, Device Class, Attributes, Domain and States are.

Image

  1. Device → Domain: Devices are grouped into domains based on their functionality. (light, sensor, binary_sensor`, ...)
  2. Domain → Device Class: Domains are refined by device classes, adding context. (motion, door, battery, temperature, ...)
  3. Domain + Device Class → Entity: Entities are created by combining domain and device class. Entity represents an individual control or sensor that Home Assistant can interact with.
  4. Entity → Attributes: Entities have additional details (e.g., brightness, battery level). (brightness, color, battery level, ...)
  5. Entity → States: Entities also define their current condition or behavior. (on, off, ...)

So Alarmo currently supports binary_sensor type of Domain with the following Device Classes.

What is confusing is that HA uses Lock as a domain https://www.home-assistant.io/integrations/lock and as a device class for e.g. binary sensor: https://www.home-assistant.io/integrations/binary_sensor/#device-class.

Thanks

@nielsfaber
Copy link
Owner

Device_class should have been called entity_class if you ask me.
This is an attribute for an entity of type binary_sensor.

Devices have not much meaning in HA. It is just a collection of entities that all correspond to a physical object in your house (like your nuki lock will consist of a ‘lock’ entity but maybe also a battery level sensor etc). It is only a means of organising the many entities that a HA setup has.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants