Closed soif closed 2 months ago
As designed, domoticz/out
(or any user defined DOMOTICZ_OUT_TOPIC) overrules the rule subscribe functionality. If you want to act on domotics/out/idx
you will need to configure the index for the relay in the tasmota domoticz GUI config screen or use command DzIdx<relay number> <domoticz index>
.
Hi, thanks for the fast answer 😎
I've put (above) some very basic rules (to ease fast understanding of the issue) but in fact, i want to grab some sensor values from Domoticz (ie temperature, humidity, wind speed etc....) and then display them on a Tasmota powered Oled display. So DzIdx is not relevant in this case.
When values come from other Tasmotas, it's work perfectly well by subscribing to tele/otherTasmota/sensor , but for others sensors (ie: RF, MySensors, EspEasy, other non MQTT sensors,etc...) I've no other choice than using the domoticz/out topic to grab them.
(I know I could always make a custom Domoticz script to do that, but its' a bit overkill for such simple tasks)
Being supported directly in Tasmota, would be a lot easier. (if it's too complicated to change the code to receive domoticz/out both for relays AND for subscribing, it could also be implemented as a compilation flag that switches between one of the 2 behaviors)
Makes sense?
In that case compile your own binary disabling Domoticz and you're free to use subscribe as you like.
will do. thanks for the tips. 👍
As designed,
domoticz/out
(or any user defined DOMOTICZ_OUT_TOPIC) overrules the rule subscribe functionality.
This information would actually deserve to be noted in the documentation at : https://tasmota.github.io/docs/MQTT/#subscribe
Would you like if i submit to this page something like:
!!! tip "Domoticz Users" As designed,
domoticz/out
(or any user defined DOMOTICZ_OUT_TOPIC) overrules the rule subscribe functionality. This means that you can't subscribe to this topic, except if you had disabled theUSE_DOMOTICZ
flag when compiling your own firmware
mmm is there perhaps someone that have a simple how to.. windows noob here. Will use the 8 channels, with domoticz, only perhaps can i work with mqtt or node red..?
Last question related to https://github.com/arendst/Tasmota/discussions/21066
Let's keep the conversation here where I will allow users to add additional DzIdx relation kept in RAM to be executed once at start by a rule. No subscribe needed.
So try latest dev branch.
This allows to configure additional relays5 until 32 with domoticz command DzIdx<relay> <domoticz_idx>
.
To make the relation persistent add following rule where 403 and 1234 are known Domoticz idx for relay5 (=power5) and relay6 (=power6):
rule1 on system#boot do backlog DzIdx5 403; DzIdx6 1234 endon
rule1 1
As a bonus to this change no more restarts needed if configuring Domoticz parameters ;-)
This allows to configure additional relays5 until 32 with domoticz command DzIdx
.
Many Thanks for this smart addition. While it doesn't change anything, about the initial question to subscribe to Dz sensors, it is a very helpful feature for project (like a couple of mines, but certainly a lot of other users too) when we need to handle more than 4 "relays", easily. 😎 👍
Regarding my proposal of amending the documentation regarding Dz/out subscribe limitations, I'm gonna pull a PR, for you to decide to accept or reject it.
THANKS for the great work... Likt to test, only is there ota link for upgrade to the relaease?
You do not need to wait for next release, fresh development builds are here: https://ota.tasmota.com/tasmota/ And you can copy/paste from the "OTA URL" column for an upgrade. (Do not copy the https links from the "OTA Firmware" column).
this are teh realese? Not the development ota, or am i wrong
No, the link I posted is development, and the timestamp shows how fresh they are. Also, the header clearly says "Development binaries".
If you wanted release instead: https://ota.tasmota.com/tasmota/release/
So try latest dev branch.
This allows to configure additional relays5 until 32 with domoticz command
DzIdx<relay> <domoticz_idx>
.To make the relation persistent add following rule where 403 and 1234 are known Domoticz idx for relay5 (=power5) and relay6 (=power6):
rule1 on system#boot do backlog DzIdx5 403; DzIdx6 1234 endon rule1 1
As a bonus to this change no more restarts needed if configuring Domoticz parameters ;-)
theo, Test the new channel 5 and 6 [ and i hope 7 and 8 :-) ]
Did a update to latstest dev.
in the consule i did:
rule1 on system#boot do backlog DzIdx5 8077; DzIdx6 8078endon rule1 1
10:14:59.469 CMD: rule1 on system#boot do backlog DzIdx5 8077; DzIdx6 8078endon rule1 1 10:14:59.474 RUL: Stored uncompressed, would compress from 63 to 46 (-27%) 10:14:59.479 MQT: stat/homeassistant/RESULT = {"Rule1":{"State":"OFF","Once":"OFF","StopOnError":"OFF","Length":63,"Free":448,"Rules":"on system#boot do backlog DzIdx5 8077; DzIdx6 8078endon rule1 1"}} 10:15:27.247 MQT: tele/homeassistant/STATE = {"Time":"2024-04-01T10:15:27","Uptime":"0T00:05:10","UptimeSec":310,"Heap":25,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":21,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","POWER3":"OFF","POWER4":"OFF","POWER5":"OFF","POWER6":"ON","POWER7":"ON","POWER8":"ON","Wifi":{"AP":1,"SSId":"D.M.","BSSId":"C8:7F:54:47:66:A0","Channel":9,"Mode":"11n","RSSI":60,"Signal":-70,"LinkCount":1,"Downtime":"0T00:00:04"}} 10:16:54.061 CMD: rule 1 10:16:54.069 MQT: stat/homeassistant/RESULT = {"Rule1":{"State":"ON","Once":"OFF","StopOnError":"OFF","Length":63,"Free":448,"Rules":"on system#boot do backlog DzIdx5 8077; DzIdx6 8078endon rule1 1"}}
Only the channel 5 and 6 are not switching. when i use the switch [ with 8977 or 8078] in domoticz Also not after a reboot.
Where do i go wrong
rule1 on system#boot do backlog DzIdx5 8077; DzIdx6 8078endon
rule1 1
That's broken. First, you need a space before endon
, otherwise you have no rule. Second, you cannot copy/paste independent commands in one operation, but have to issue two separate commands. As you only used one copy/paste, your output shows the bad result.
10:14:59.479 MQT: stat/homeassistant/RESULT = {"Rule1":{"State":"OFF","Once":"OFF","StopOnError":"OFF","Length":63,"Free":448,"Rules":"on system#boot do backlog DzIdx5 8077; DzIdx6 8078endon rule1 1"}}
rule1 on system#boot do backlog DzIdx5 8077; DzIdx6 8078endon rule1 1
That's broken. First, you need a space before
endon
, otherwise you have no rule. Second, you cannot copy/paste independent commands in one operation, but have to issue two separate commands. As you only used one copy/paste, your output shows the bad result.10:14:59.479 MQT: stat/homeassistant/RESULT = {"Rule1":{"State":"OFF","Once":"OFF","StopOnError":"OFF","Length":63,"Free":448,"Rules":"on system#boot do backlog DzIdx5 8077; DzIdx6 8078endon rule1 1"}}
sorry, first time using rules....
So this should be good? rule1 on system#boot do backlog DzIdx5 8077 endon rule1 1
Perhaps otherwise an good example rule, please
I suggest you start to read here https://tasmota.github.io/docs/Rules/ and continue from there.
In short, this is the valid rule:
rule1 on system#boot do backlog DzIdx5 8077 endon
followed by a one-time command rule1 1
enterd by you.
I suggest you start to read here https://tasmota.github.io/docs/Rules/ and continue from there.
In short, this is the valid rule:
rule1 on system#boot do backlog DzIdx5 8077 endon
followed by a one-time command
rule1 1
enterd by you.
WORKS!!!! only after a reboot.
Only now swiths 6: rule2 on system#boot do backlog DzIdx5 8078 endon [ enter]
rule2 2 [ enter ]? Or rule2 1 ?
And for the future,how to reset a rule?
Ps i read the rules pages, only a windoows noob here from early 60's :-)
You need both DzIdx commands at the same time, just like what you originally had. No one was suggesting you to only have one of those, just to fix the errors in the rest of the line.
No excuse not to to try to understand the docs. You managed Nodo in the past, Tasmota is no different.
No excuse not to to try to understand the docs. You managed Nodo in the past, Tasmota is no different.
nodo that was very hard to get for me.. A long time ago And yes i did try that also, only then there was domoticz..:-) And then there was espeasy, and finaly tasmota :-)
Did:
16:07:00.227 CMD: DzIdx0 0
16:07:00.233 MQT: stat/Houthok_midden/RESULT = {"Command":"Error"}
Found something other stranges....
The relais are not working like they says in to the template explanation:
in this setting relais 6 and 8 are not working.
With this setting are all relais working:
When i use the webui....
After this cms:
rule1 on system#boot do backlog DzIdx5 8078; DzIdx6 8105; DzIdx7 8080; DzIdx8 15822 endon
Almost all the idx with domoticcz are woring only 6 not. idx 8105 not working from domoticz, when i push the webui button working fine..
Try a lot of other settings, only DzIdx6 8105; is not working... with teh template setting like the website says
Using DzIdx0 0
would only be valid after updating to the very most recent build.
Is it not possible te set an switch to a other gpio? I think there is something wrong in the template.
All working only relay 7 is not..
GPIO 4
All other gpio are not working, this is the only config that is working.
Strange is that with the rule code, the 7 is not working with a idx from domoticz, and in the webui from the wifiboard the swicht is working well.
Hope someone hava a idea.
PROBLEM DESCRIPTION
A clear and concise description of what the problem is.
Subscribing to the domoticz/out/ MQTT topic don't work
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255
:09:24:51.947 MQT: stat/tasmota_5A440E/RESULT = {"NAME":"Generic","GPIO":[1,1,1,1,1,1,1,1,1,1,1,1,1,1],"FLAG":0,"BASE":18} 09:24:52.176 MQT: stat/tasmota_5A440E/RESULT = {"Module":{"1":"Sonoff Basic"}} 09:24:52.430 MQT: stat/tasmota_5A440E/RESULT = {"GPIO0":{"32":"Button1"},"GPIO1":{"0":"None"},"GPIO2":{"0":"None"},"GPIO3":{"0":"None"},"GPIO4":{"0":"None"},"GPIO5":{"0":"None"},"GPIO9":{"0":"None"},"GPIO10":{"0":"None"},"GPIO12":{"224":"Relay1"},"GPIO13":{"320":"Led_i1"},"GPIO14":{"0":"None"},"GPIO15":{"0":"None"},"GPIO16":{"0":"None"},"GPIO17":{"0":"None"}}
Status 0
:09:26:48.978 MQT: stat/tasmota_5A440E/STATUS = {"Status":{"Module":1,"DeviceName":"Tasmota","FriendlyName":["Tasmota"],"Topic":"tasmota_5A440E","ButtonTopic":"0","Power":1,"PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0,"StatusRetain":0}} 09:26:48.991 MQT: stat/tasmota_5A440E/STATUS1 = {"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota/release/tasmota.bin.gz","RestartReason":"Software/System restart","Uptime":"0T00:15:42","StartupUTC":"2024-03-24T08:11:06","Sleep":50,"CfgHolder":4617,"BootCount":2,"BCResetTime":"2024-03-24T09:10:17","SaveCount":8,"SaveAddress":"F4000"}} 09:26:49.001 MQT: stat/tasmota_5A440E/STATUS2 = {"StatusFWR":{"Version":"13.4.0.3(tasmota)","BuildDateTime":"2024-03-24T09:07:44","Boot":31,"Core":"2_7_6","SDK":"2.2.2-dev(38a443e)","CpuFrequency":80,"Hardware":"ESP8266EX","CR":"374/699"}} 09:26:49.009 MQT: stat/tasmota_5A440E/STATUS3 = {"StatusLOG":{"SerialLog":2,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["iot",""],"TelePeriod":300,"Resolution":"558180C0","SetOption":["00008009","2805C80001000600003C5A0A192800000000","00000080","00006000","00004000","00000000"]}} 09:26:49.028 MQT: stat/tasmota_5A440E/STATUS4 = {"StatusMEM":{"ProgramSize":646,"Free":356,"Heap":21,"ProgramFlashSize":1024,"FlashSize":4096,"FlashChipId":"164020","FlashFrequency":40,"FlashMode":"DOUT","Features":["0809","8F9AC787","04368001","000000CF","010013C0","C000F981","00004004","00001000","54000020","00000080","00000000"],"Drivers":"1,2,!3,!4,!5,!6,7,!8,9,10,12,!16,!18,!19,!20,!21,!22,!24,26,!27,29,!30,!35,!37,!45,62,!68","Sensors":"1,2,3,4,5,6","I2CDriver":"7"}} 09:26:49.044 MQT: stat/tasmota_5A440E/STATUS5 = {"StatusNET":{"Hostname":"tasmota-5A440E-1038","IPAddress":"10.1.209.241","Gateway":"10.1.11.1","Subnetmask":"255.255.0.0","DNSServer1":"10.1.10.1","DNSServer2":"10.1.11.1","Mac":"5C:CF:7F:xx:xx:xx","Webserver":2,"HTTP_API":1,"WifiConfig":4,"WifiPower":17.0}} 09:26:49.053 MQT: stat/tasmota5A440E/STATUS6 = {"StatusMQT":{"MqttHost":"10.1.12.114","MqttPort":1883,"MqttClientMask":"DVES%06X","MqttClient":"DVES_5A440E","MqttUser":"DVES_USER","MqttCount":1,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":4}} 09:26:49.067 MQT: stat/tasmota_5A440E/STATUS7 = {"StatusTIM":{"UTC":"2024-03-24T08:26:49Z","Local":"2024-03-24T09:26:49","StartDST":"2024-03-31T02:00:00","EndDST":"2024-10-27T03:00:00","Timezone":"+01:00","Sunrise":"06:43","Sunset":"19:08"}} 09:26:49.076 MQT: stat/tasmota_5A440E/STATUS10 = {"StatusSNS":{"Time":"2024-03-24T09:26:49"}} 09:26:49.085 MQT: stat/tasmota_5A440E/STATUS11 = {"StatusSTS":{"Time":"2024-03-24T09:26:49","Uptime":"0T00:15:43","UptimeSec":943,"Heap":21,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER":"ON","Wifi":{"AP":1,"SSId":"iot","BSSId":"8A:C3:97:xx:xx:xx","Channel":6,"Mode":"11n","RSSI":62,"Signal":-69,"LinkCount":1,"Downtime":"0T00:00:04"}}}
TO REPRODUCE
Steps to reproduce the behavior:
(in Tasmota)
(From the mosquitto server console)
Test 1 (tasmota ignore it) :
mosquitto_pub -t 'domoticz/out/1000' -m '{"svalue1": "40"}'
Test 2 (tasmota recognize it properly)
mosquitto_pub -t 'domoti/out/1000' -m '{"svalue1": "40"}'
EXPECTED BEHAVIOUR
A clear and concise description of what you expected to happen.
Tasmota should answer to domoticz/out/IDX
SCREENSHOTS
If applicable, add screenshots to help explain your problem.
ADDITIONAL CONTEXT
Add any other context about the problem here.
As advised by @arendst here, I've switched domoticz to output MQTT messages by Index, to be sure that MQTT message are not too big... Anyway, using the (previous) very short mosquitto_pub payloads, produces the same results.
(Please, remember to close the issue when the problem has been addressed)