Thanks Francis.
I have changed one of my sonof’s to not have the leading /… Tried to listen again under Developer Tools > Events and #… Nothin
Also, still no change in the state…
- platform: mqtt
name: "Living Room Window"
command_topic: "Home/Outside/IoT-Sonoff-4/cmnd/Power"
state_topic: "Home/Outside/IoT-Sonoff-4/stat/Power"
state_value_template: "{{ value_json.POWER }}"
value_template: "{{ value_json.POWER }}"
payload_on: "ON"
payload_off: "OFF"
state_off: "OFF"
state_on: "ON"
retain: false
When I listen to “call_service” under Dev> Events
and turn off and on this light from the Lovelace UI
Event 5 fired 11:06 AM:
{
"event_type": "call_service",
"data": {
"domain": "mqtt",
"service": "publish",
"service_data": {
"topic": "Home/Outside/IoT-Sonoff-4/cmnd/Power",
"qos": 0,
"retain": false,
"payload": "OFF"
}
},
"origin": "LOCAL",
"time_fired": "2020-03-25T04:06:53.695287+00:00",
"context": {
"id": "0f99cd66dfa14684a9a6f6f462783942",
"parent_id": null,
"user_id": null
}
}
Event 4 fired 11:06 AM:
{
"event_type": "call_service",
"data": {
"domain": "switch",
"service": "turn_off",
"service_data": {
"entity_id": "switch.living_room_window"
}
},
"origin": "LOCAL",
"time_fired": "2020-03-25T04:06:53.694227+00:00",
"context": {
"id": "135bea19e3614a6b9d08c2494534f397",
"parent_id": null,
"user_id": "3acc9e2704cb46cd86576e86eedb7333"
}
}
Event 3 fired 11:06 AM:
{
"event_type": "call_service",
"data": {
"domain": "mqtt",
"service": "publish",
"service_data": {
"topic": "Home/Outside/IoT-Sonoff-4/cmnd/Power",
"qos": 0,
"retain": false,
"payload": "ON"
}
},
"origin": "LOCAL",
"time_fired": "2020-03-25T04:06:53.041330+00:00",
"context": {
"id": "e79d80962ebd42cea60871719bd9cabc",
"parent_id": null,
"user_id": null
}
}
Event 2 fired 11:06 AM:
{
"event_type": "call_service",
"data": {
"domain": "switch",
"service": "turn_on",
"service_data": {
"entity_id": "switch.living_room_window"
}
},
"origin": "LOCAL",
"time_fired": "2020-03-25T04:06:53.040250+00:00",
"context": {
"id": "54479e877f804b62999fa340d8bc57c5",
"parent_id": null,
"user_id": "3acc9e2704cb46cd86576e86eedb7333"
}
}
Event 1 fired 11:06 AM:
{
"event_type": "call_service",
"data": {
"domain": "mqtt",
"service": "publish",
"service_data": {
"topic": "Home/Outside/IoT-Sonoff-4/cmnd/Power",
"qos": 0,
"retain": false,
"payload": "ON"
}
},
"origin": "LOCAL",
"time_fired": "2020-03-25T04:06:48.139784+00:00",
"context": {
"id": "c4c76e77ca3e45aa81c085d7746153a8",
"parent_id": null,
"user_id": null
}
}
Event 0 fired 11:06 AM:
{
"event_type": "call_service",
"data": {
"domain": "switch",
"service": "turn_on",
"service_data": {
"entity_id": "switch.living_room_window"
}
},
"origin": "LOCAL",
"time_fired": "2020-03-25T04:06:48.136890+00:00",
"context": {
"id": "b6b85cf230854283afaad36d3b8124c0",
"parent_id": null,
"user_id": "3acc9e2704cb46cd86576e86eedb7333"
}
}
maybe I cannot debug MQTT messages from the Developer Tools > Events
When I look in the logs I see
Log Details (WARNING)
Wed Mar 25 2020 10:58:05 GMT+0700 (Indochina Time)
Your configuration contains extra keys that the platform does not support.
Please remove [state_value_template]. (See /config/switch.yaml, line 23).
Offending data: {"platform": "mqtt", "name": "Living Room Window", "command_topic": "Home/Outside/IoT-Sonoff-4/cmnd/Power", "state_topic": "Home/Outside/IoT-Sonoff-4/stat/Power", "state_value_template": "{{ value_json.POWER }}", "value_template": "<redacted>", "payload_on": "<redacted>", "payload_off": "<redacted>", "state_off": "<redacted>", "state_on": "<redacted>", "retain": "<redacted>"}
Honestly at a loss here and not find the right documentation to piece my solution toggether…