-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
[feat] change entity type sent to hass - for example a switch becomes a light #161
Comments
this is the hass json created by zwavejs2mqtt
|
and extra credit - does hass differentiate lights that support only binary state vs can be dimmed - if so i would want hass to see this as a binary light. |
@scyto, zjs2m is reporting it correctly to HASS. The device you have is a switch. I also have a switch that I use to control a light. To get around that issue I used the HASS light switch integration. https://www.home-assistant.io/integrations/light.switch/ .. It creates a light in HASS that is controlled by a switch. So, you can use that light switch integration to create a "light" device that uses the "switch" that zjs2m created in HASS. Then you can use that new "light" in the blueprint you mentioned. |
@chilicheech looks like that integration isn't one of the in UI ones? I tend to stay away from the ones I manually have to do in YAML as I see they keep deprecating them. Either way this seems like a double hop of manual effort not to mention won't this result in a duplicative entity or device? I am already struggling with entity / device sprawl in the UI :-( Another question that springs to mind is that integration only supports a binary switch, what about z-wave dimmers - is there a similar integration? I can see how someone old to hass is ok doing everything via yaml I still maintain this is a useful feature - it isn't important that it reports correctly in my mind but that it reports in the most useful way possible. I see no issue with allowing an optional abstraction like this (other than opportunity cost wrt other features). |
i guess my real issue here is hass inability to differentiate outlet switch, in-wall light switch, bulb, light with switch (like a table lamp) The in-wall switch example i gave is just one of a few scenarios based on my experience with other home automation systems reclassification is a useful feature. I note hass has such a feature https://www.home-assistant.io/docs/configuration/customizing-devices/#device-class but doesn't seem like it is supported for many entity types. For now i can use the integration you suggest as it solves my immediate problem. |
I think the ability to optionally classify it as either a light switch or a switch (a.k.a, light vs switch domain in HASS) would be an awesome feature to add. I think z2m can't assume by default that all in-wall switches are light switches, as some folks may be switching other types of loads with them. The option to have HASS discover it as a light or a switch would solve the issue. |
Totally agree on the assumption part, assuming it is switch makes total sense, letting one override that in z2m would be sweet. For example if the drop down to override was light, fan, etc (other domains basically) it would give a lot of flexibility (i have a switch unit - the little black things that have no actual physical switch on them controlling a fan load in my attic; the one in the picture above is a paddle switch). BTW thanks for the workaround you gave me, it will do for now :-) |
@scyto You should be able to change the default device class by adding that value to gateway values table and set a custom device class. |
i tried and never managed to figure it out, the device class IIRC kept changing, i will try again |
@scyto You can change the device class in both ways, if you do it directly by editing the discovery json remember to press the store button to store the configuration so it will not be overwritten on next startup |
thanks, on the 'new item' i can't populate the device class - it just says no data available. I can try the store, i think i understand the logic of that now (i read the docs more carefully tonight) |
@scyto Could you retry with the master? in my last commit I have fixed an issue that caused that select to be always empty |
i just pulled :master and used that container, assuming it has latest commit then it doesn't seem fixed? --edit-- i have the new movie icon from 42 minutes ago, so yeah is latest and for me exhibits the same behavior as dev |
just to make sure i am on same page - that error in the picture is for device class |
What you mean exactly? Are you using docker? |
yes i pulled the tag master from docker bub and switched to that image on my container. |
@scyto Use |
@scyto Please send me the export of that node when you can (go to control panel select the node and click on export) |
as requested (interestingly if i open the node and use the export from within the nodes details pane, i get the two json files in the attached zip; but if i select the check-box for the node and use the export at the top of the nodes table one of the json files just contains undefined) |
also to add, every single node I have shows as no data available for device class |
@scyto AFAIK switch doesn't support |
indeed that's why i wanted to be able to surface this as light device to HAAS, it only operates as a light (on / off), the feature would be to allow this binary switch to be added to the hassprefix/light topic instead of the hassprefix/switch topic - though i realize the heavy lift that would be. I have a workaround using the switch to light integration in configuration.yaml so no need to go any further at this juncture unless i find other uses cases for the ability to reclassify (aka lie to HA). |
@billiaz Thoughts? |
I am new to hass, apologies if I get terminology wrong.
Is your feature request related to a problem? Please describe.
I have jasco in wall z-wave switches that control a load that is only a light.
These get called switch.name in entity, i think this means they are in the switch domain.
I downloaded a blue print that turns lights on at sunset for a defined area and all devices in it that are lights.
It doesn't work with my switches and my switches cannot be added as the blue print is looking only for entities with the domain of light.
Describe the solution you'd like
I would like an easy way in zwavejs.mqtt has discoverabilty to change the device/entity/domain type (sorry not sure what word to use, but i think it is domain) so that the device/enitiy would be see by HAAS as a light. I assume I can do this in the json and republish but I am unclear what i should change. This scenario seems like it would be quite common - aka the zwave node makes more sense to refer to what it controls, not what it is. In terms of easy a drop down of supported domains would be nice :-)
Describe alternatives you've considered
I think i can edit the blue print - but then if the community owner revises the blueprint i am on the hook for doing that to my 'fork'.
I think i can edit the hass discovery json - but i have no idea which of those things that say switch i should change to light?
Additional context
this is the blue print in question, i don't want to fork community blue prints if i can avoid it!
The text was updated successfully, but these errors were encountered: