can anyone pass me the configuration of the mqtt switch on home assistant? i can't get it to work. If someone had also made a sensor with the data read I would be grateful.
mqtt home assistant configuration
-
- Shelly PRO 4PM
-
ghizmo82 -
13. September 2021 um 20:14 -
Unerledigt
-
-
unfortunally im also after that and i was able to do it via mqtt, via integration nothing
-
Afaik integration via websocket is in the pipeline and will be releasen soon..
-
A quick approach to mqtt in Home Assistant:
For light:
Code
Alles anzeigenlight: - platform: mqtt schema: template name: "switch1" unique_id: "shellypro4pm-XXXXXXXXXXXX-switch-0" command_topic: "shellypro4pm-XXXXXXXXXXXX/rpc" command_on_template: '{"id": 1, "src":"homeassistant", "method": "Switch.Set", "params": {"id": 0, "on": true}}' command_off_template: '{"id": 1, "src":"homeassistant", "method": "Switch.Set", "params": {"id": 0, "on": false}}' state_topic: "shellypro4pm-XXXXXXXXXXXX/status/switch:0" state_template: "{% if value_json.output %}on{% else %}off{% endif %}" json_attributes_topic: "shellypro4pm-XXXXXXXXXXXX/status/switch:0" qos: 1
for switch:
Code
Alles anzeigenswitch: - platform: mqtt name: "switch1 unique_id: "shellypro4pm-XXXXXXXXXXXX-switch-1" command_topic: "shellypro4pm-XXXXXXXXXXXX/rpc" payload_on: '{"id": 1, "src":"homeassistant", "method": "Switch.Set", "params": {"id": 1, "on": true}}' payload_off: '{"id": 1, "src":"homeassistant", "method": "Switch.Set", "params": {"id": 1, "on": false}}' state_topic: "shellypro4pm-XXXXXXXXXXXX/status/switch:1" value_template: "{{ value_json.output }}" state_on: 'true' state_off: 'false' json_attributes_topic: "shellypro4pm-XXXXXXXXXXXX/status/switch:1" qos: 1
On shelly mqtt web config: Generic status update over MQTT: ENABLE
Hope it helps.