-
Notifications
You must be signed in to change notification settings - Fork 6
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
Support for states on EntityCommands, Monitor entity as a switch with state topic #29
Conversation
Hi @infeeeee, What do you think if I take your solution but editing it in this way: command data entity will take an optional key of a command entity sensor, so when the value is edited to the sensor, it's sent like in your solution as state of the command. In case you didn't understand I could be more clear. |
In this way, warehouses that do not support switches/switches with value, can simply use the sensor to take the value |
Ok, I understand what you are saying, so there should be a separate Monitor command and a Monitor sensor, and only combine them in the Homeassistant and MQTT warehouse, where it makes sense to combine them, and use the same topic as state and command. I like this approach! I will close this and create a new PR, and cherrypick commits from here, as this requires a lot of changes, and this branch now contains a lot of unnecessary changes. It think they should be separate from this Monitor command, as ExternalDisplay or DisplayConfiguration or something, and they could be displayed as a Select Entity in HomeAssistant: |
Exactly (not two different entity but the sensor data and command data in the same entity, just to be sure we're on the same idea). I totally agree to add a different entity for the configurations. |
Also the Select entity in Hass would be so nice ! Great idea |
I see now, I should use both |
Yes, but the link to the Sensor from the Command is not ready yet. |
With this changes it's now possible to set a state for an EntityCommand, and publish it. In HomeAssistant Switches can show up as a real switch, with correct states. https://www.home-assistant.io/integrations/switch.mqtt/#state_topic
I implemented first for the Monitor entity. Unfortunately on windows you cannot get the states of the monitors, so this only works on linux, with X11. In HA for Windows machines, there is one switch now, with ON and OFF buttons, so only one line on the UI.
Tested on both Windows and Linux.