-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Use 'occupancy' device_class instead of 'motion' for occupancy sensors #22896
Conversation
'occupancy' matches the zigbee terminology more closely and is more consistent with other Home Assistant entities of this type. https://www.home-assistant.io/integrations/binary_sensor/ In general, it looks like 'motion' is more for alarms, and 'occupancy' for non-alarm situations. Z2M currently makes no distinction between these concepts, but they could be separated (with a fair amount of work).
Thanks! |
… sensors (Koenkk#22896) 'occupancy' matches the zigbee terminology more closely and is more consistent with other Home Assistant entities of this type. https://www.home-assistant.io/integrations/binary_sensor/ In general, it looks like 'motion' is more for alarms, and 'occupancy' for non-alarm situations. Z2M currently makes no distinction between these concepts, but they could be separated (with a fair amount of work).
put everything back, now the motion sensor shows the "house" icon instead of the "running man"! |
Yes, unfortunately there is not currently a separate category for "occupancy" vs "motion" in z2m. It would be more work to add this. You can always override the type in Home Assistant, see https://www.home-assistant.io/docs/configuration/customizing-devices/ |
so this is a temporary solution? Maybe I don’t need to change anything yet? Does this require some work on your part or on the home assistant side? |
Once you set the "shown as" explicitly in HA, then z2m won't change it again. So if you are ok with changing this manually once for each affected sensor, you should be all set. (Until there is a better solution, you'll need to do this manual step each time you configure a new sensor.) Does this seem ok? |
You can override the HA discovery on a device or global level in the z2m device_options:
homeassistant:
occupancy:
device_class: motion rather than changing it manually for each and every sensor. Right now there is no way to automatically identiy motion and real occupancy :-/ |
But isn't the device used telling you what is should be? Just asking, stumbled in here as my icons changed after upgrading z2m. |
@Koenkk Might be an idea to introduce a breaking changes section in the release notes because this breaks every Home Assistant instance that uses device class/entity types in their scripts (e.g. a script getting all motion entities in an area). Perhaps automatically generated in the notes by labeling such tickets as potentially breaking. Took me an hour to figure out why my scripts weren't working anymore after updating to 1.39 😅 I usually go through the release notes before updating but even I missed it (and most people probably just update blindly). This is a small change, but it already affected four people in my direct bubble. Thanks 😀 |
@Broekman I was not aware this would be a breaking change, but it's too late to revert now |
Yes, I didn't realize that either. Sorry about the unexpected churn. |
'occupancy' matches the zigbee terminology more closely and is more consistent with other Home Assistant entities of this type.
https://www.home-assistant.io/integrations/binary_sensor/
In general, it looks like 'motion' is more for alarms, and 'occupancy' for non-alarm situations. Z2M currently makes no distinction between these concepts, but they could be separated (with a fair amount of work).