Hello to all,
I’m trying to integrate a SonOff 4Ch R3 Relay board with HA. The device gets recognized on HA but I cannot change the relay status from HA. Seems something wrong, but cannot understand if it’s on HA side or on Tasmota. Strange is that, if I change the relay status from Tasmota, HA gets updated, but if I change the Relay status from HA, nothing happens on the board. I’ve only noticed that from HA the MQTT publish is not all UPPERCASE like from Tasmota.
Here some details:
Tasmota:
Program Version 9.1.0(tasmota)
Build Date & Time 2020-11-07T11:57:45
Core/SDK Version 2_7_4_5/2.2.2-dev(38a443e)
Uptime 0T00:02:55
Flash write Count 67 at 0xF9000
Boot Count 9
Restart Reason Software/System restart
Friendly Name 1 RELAY02-01
Friendly Name 2 RELAY02-02
Friendly Name 3 RELAY02-03
Friendly Name 4 RELAY02-04
MQTT Host 192.168.1.13
MQTT Port 1883
MQTT User mqtt_user
MQTT Client DVES_D04DF5
MQTT Topic GARDEN02
MQTT Group Topic 1 XefilHome/tasmotas/cmnd/
MQTT Full Topic XefilHome/GARDEN02/cmnd/
MQTT Fallback Topic cmnd/DVES_D04DF5_fb/
MQTT No Retain Disabled
After boot, if I set SetOption19 0
the Integration disappear, then setting it back to 1, it comes back correctly in HA:
00:01:21 CMD: SetOption19 1
00:01:21 MQT: XefilHome/GARDEN02/RESULT = {"SetOption19":"ON"}
00:01:22 MQT: homeassistant/switch/D04DF5_RL_1/config = {"name":"RELAY02-01","stat_t":"XefilHome/GARDEN02/STATE","avty_t":"XefilHome/GARDEN02/LWT","pl_avail":"Online","pl_not_avail":"Offline","cmd_t":"XefilHome/GARDEN02/cmnd/POWER1","val_tpl":"{{value_json.POWER1}}","pl_off":"OFF","pl_on":"ON","uniq_id":"D04DF5_RL_1","dev":{"ids":["D04DF5"]}} (retained)
00:01:22 MQT: homeassistant/switch/D04DF5_RL_2/config = {"name":"RELAY02-02","stat_t":"XefilHome/GARDEN02/STATE","avty_t":"XefilHome/GARDEN02/LWT","pl_avail":"Online","pl_not_avail":"Offline","cmd_t":"XefilHome/GARDEN02/cmnd/POWER2","val_tpl":"{{value_json.POWER2}}","pl_off":"OFF","pl_on":"ON","uniq_id":"D04DF5_RL_2","dev":{"ids":["D04DF5"]}} (retained)
00:01:22 MQT: homeassistant/switch/D04DF5_RL_3/config = {"name":"RELAY02-03","stat_t":"XefilHome/GARDEN02/STATE","avty_t":"XefilHome/GARDEN02/LWT","pl_avail":"Online","pl_not_avail":"Offline","cmd_t":"XefilHome/GARDEN02/cmnd/POWER3","val_tpl":"{{value_json.POWER3}}","pl_off":"OFF","pl_on":"ON","uniq_id":"D04DF5_RL_3","dev":{"ids":["D04DF5"]}} (retained)
00:01:22 MQT: homeassistant/switch/D04DF5_RL_4/config = {"name":"RELAY02-04","stat_t":"XefilHome/GARDEN02/STATE","avty_t":"XefilHome/GARDEN02/LWT","pl_avail":"Online","pl_not_avail":"Offline","cmd_t":"XefilHome/GARDEN02/cmnd/POWER4","val_tpl":"{{value_json.POWER4}}","pl_off":"OFF","pl_on":"ON","uniq_id":"D04DF5_RL_4","dev":{"ids":["D04DF5"]}} (retained)
00:01:22 MQT: homeassistant/sensor/D04DF5_status/config = {"name":"GARDEN02 status","stat_t":"XefilHome/GARDEN02/HASS_STATE","avty_t":"XefilHome/GARDEN02/LWT","pl_avail":"Online","pl_not_avail":"Offline","json_attr_t":"XefilHome/GARDEN02/HASS_STATE","unit_of_meas":"%","val_tpl":"{{value_json['RSSI']}}","ic":"mdi:information-outline","uniq_id":"D04DF5_status","dev":{"ids":["D04DF5"],"name":"GARDEN02","mdl":"Sonoff 4CH Pro","sw":"9.1.0(tasmota)","mf":"Tasmota"}} (retained)
00:01:29 CMD: SetOption19 0
00:01:29 MQT: XefilHome/GARDEN02/RESULT = {"SetOption19":"OFF"}
00:01:30 LOG: Home Assistant MQTT Discovery disabled.
So, then if I turn a relay on/off on Tasmota:
00:01:59 MQT: XefilHome/GARDEN02/RESULT = {"POWER1":"ON"}
00:01:59 MQT: XefilHome/GARDEN02/POWER1 = ON
00:02:01 MQT: XefilHome/GARDEN02/STATE = {"Time":"1970-01-01T00:02:01","Uptime":"0T00:02:03","UptimeSec":123,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","POWER3":"OFF","POWER4":"OFF","Wifi":{"AP":1,"SSId":"XefilHQ","BSSId":"E0:28:6D:7B:CE:48","Channel":11,"RSSI":100,"Signal":-39,"LinkCount":1,"Downtime":"0T00:00:03"}}
00:02:01 MQT: XefilHome/GARDEN02/RESULT = {"POWER1":"OFF"}
00:02:01 MQT: XefilHome/GARDEN02/POWER1 = OFF
On HA the status gets updated:
2020-11-17 22:26:27 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on XefilHome/GARDEN02/RESULT: b'{"POWER1":"ON"}'
2020-11-17 22:26:27 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on XefilHome/GARDEN02/POWER1: b'ON'
2020-11-17 22:26:29 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on XefilHome/GARDEN02/STATE: b'{"Time":"1970-01-01T00:02:01","Uptime":"0T00:02:03","UptimeSec":123,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","POWER3":"OFF","POWER4":"OFF","Wifi":{"AP":1,"SSId":"XefilHQ","BSSId":"E0:28:6D:7B:CE:48","Channel":11,"RSSI":100,"Signal":-39,"LinkCount":1,"Downtime":"0T00:00:03"}}'
2020-11-17 22:26:29 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on XefilHome/GARDEN02/RESULT: b'{"POWER1":"OFF"}'
2020-11-17 22:26:29 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on XefilHome/GARDEN02/POWER1: b'OFF'
But if I do the same operation on HA, nothing happens on the board:
2020-11-17 22:28:52 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on XefilHome/GARDEN02/Power1: 'ON', mid: 316
2020-11-17 22:28:52 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on XefilHome/GARDEN02/Power1: b'ON'
Even If I try from the MQTT interface from HA, the logs shows:
2020-11-17 22:32:04 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on XefilHome/GARDEN02/POWER1: 'ON', mid: 320
2020-11-17 22:32:04 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on XefilHome/GARDEN02/POWER1: b'ON'
But nothing happens on the Tasmota.
Last but not least, from a Linux board, if I try to publish the state to MQTT, the HA gets a log entry, but the relay is not updated on HA, neither on the board:
# mosquitto_pub -h 192.168.1.13 -u mqtt_user -P Jga-3J_LIBL -t XefilHome/GARDEN02/POWER1 -m "ON"
HA:
2020-11-17 22:38:08 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on XefilHome/GARDEN02/POWER1: b'ON'
Suggestions?
I’ve no idea what to check, if the problem is on HA or on Tasmota.
Thanks!
Simon