Open megamarco833 opened 3 years ago
You can check the 'send boot state' option, which should send the state at boot to the controller, if I'm not mistaken.
I try to set the box "send boot state" in relay task at node_A but issue still be present.
ciao @TD-er when you have time could you check why at reboot we have this change status? and when you have time could you read my last post? ( => why if node_B trigger domoticz (and it works, domoticz change it's status) why espeasy on node_A not react.)
hi, i was with espeasy build
ESP_Easy_mega-20200204_normal_ESP8266_4M1M.bin
on nodemcu the system has this generic setup:two switches (push button) to control with wall switches a light: wall_kitchen_1 on GPIO-5 wall_kitchen_2 on GPIO-4
one relay to switch on/off the light: kitchen_rele on GPIO-13
domoticz: dummy device named "kitchen" idx=96
scope: switch on/off the light using wall switch and use domoticz as well to control the status of the light and switch on/off also the light from domoticz.
i create a script in domoticz that when i turn off/on the idx=96 send an mqtt message: if ON it send => dz2esp_kitchen 1 if OFF it send => dz2esp_kitchen 0
inside espeasy i create a "dummy Generic - MQTT Import" named as "sniff" like this:
then i set up a rule:
so when i turn idx=96 ON domoticz send:
dz2esp_kitchen 1
espeasy rule will set GPIO13 0 (inverted relay) and relay will trigger ONif i use push button (wall switch) rule will recognize the status change and send to domoticz:
Publish domoticz/in,'{"command": "switchlight", "idx": 96, "switchcmd": "Toggle" }' // id of kitchenLight
of course this is a workaround beacuse mqtt for switch and domoticz doesn't talk properly (i should use domoticz help task, but it will require a task for every relay and it do not manage inverted relay) but this configuration as workaround was working till now.
Now i have upgraded my esp with latest espeasy firmware, but this configuration is not anymore working! ;( i see that with new firmware i receive a "ping-pong" message between domoticz and espeasy and relay is continuosy triggering on and off...and i see that domoticz is contiusoly sending the message
dz2esp_kitchen 1
anddz2esp_kitchen 0
because espeasy recognize an wall_kitchen EVENT as status change (but i do not use the wall switch i just click on domoticz idx) and espeasy send the message `Publish domoticz/in,'{"command": "switchlight", "idx": 96, "switchcmd": "Toggle" }' it will create this ping-pong message and the realy continue to loop on/offAgain this not happened with
ESP_Easy_mega-20200204_normal_ESP8266_4M1M.bin
i revert back and is working again. so my two question are: 1) why this happen on new firmware and not in previous ? 2) is not possibile to solve this situation and make working talking between switches on espeasy and domoticz with mqtt?the scenario is simple: n°1 relay for light on GPIO 13 (1=off 0=on) n°2 wall switches as push button to control the relay n°1 domoticz dummy device idx=96 to control the relay and see the status of relay (if on or off)
how to have it with mqtt and avoid to use "domoticz mqtt help task"?
espeasy should recognize message public on topic:
domoticz/out
with message OFF:{ "Battery" : 255, "LevelNames" : "Off|Level1|Level2|Level3", "RSSI" : 12, "SelectorStyle" : "0", "description" : "", "dtype" : "Light/Switch", "hwid" : "6", "id" : "000140B0", "idx" : 96, "name" : "kitchen", "nvalue" : 0, "stype" : "Selector Switch", "svalue1" : "0", "switchType" : "On/Off", "unit" : 1 }
message ON:
{ "Battery" : 255, "LevelNames" : "Off|Level1|Level2|Level3", "RSSI" : 12, "SelectorStyle" : "0", "description" : "", "dtype" : "Light/Switch", "hwid" : "6", "id" : "000140B0", "idx" : 96, "name" : "kitchen", "nvalue" : 1, "stype" : "Selector Switch", "svalue1" : "0", "switchType" : "On/Off", "unit" : 1 }
(look at idx, nvalue)
and accordingly trigger relay (GPIO13)
if you can implement this on firmware espeasy, if i trigger a push buton i can simple rule like this:
this will trigger idx of domoticz and domoticz will send the mqtt command on topic domoticz/out espeasy will receive it and will trigger accordingly the realy. what do you think? is it possible to implement / fix? thanks