Add switch to Home Assistant (e.g. for electric heater) #64
-
Hi, I would like to add a switch for the CU401B-S's electric heater to Home Assistant. Following adresses need to be written:
Added to settings_ini.py: Added to discovery json file: {
"domain": "switch",
"name": "Durchlauferhitzer",
"state_topic": "eheizung_betrieb",
"mode_command_topic": "cmnd",
"payload_on": "w;0x7902;1;1",
"payload_off": "w;0x7902;1;0",
"state_on": "1",
"state_off": "0"
}, I believe some modifications to HA_discovery.py are required, but I am struggling to get it right. Could anyone provide guidance or suggestions on how to proceed? Thank you in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I think the only thing that is not correct is that mode_command_topic should be command_topic. See also: https://www.home-assistant.io/integrations/switch.mqtt/ |
Beta Was this translation helpful? Give feedback.
-
{
"domain": "switch",
"name": "Durchlauferhitzer",
"state_topic": "eheizung_betrieb",
"command_topic": "cmnd",
"payload_on": "w;0x7902;1;1",
"payload_off": "w;0x7902;1;0",
"state_on": "1",
"state_off": "0"
}, Yes, that was the issue. The snippet above is working. Many thanks for your quick reply, and a Happy New Year to you. |
Beta Was this translation helpful? Give feedback.
I think the only thing that is not correct is that mode_command_topic should be command_topic. See also: https://www.home-assistant.io/integrations/switch.mqtt/