Hello,
If you use ESPeasy , there's an easy way to report ip and many status to domoticz check here:
https://www.letscontrolit.com/wiki/inde ... rial_Rules
https://www.letscontrolit.com/wiki/inde ... using_MQTT
And I used the Domoticz Json URLS:
https://www.domoticz.com/wiki/Domoticz_ ... _variables
Personnaly I made this rules:
Code: Select all
On System#Boot do //When the ESP boots, do
SendToHTTP DomoticzIPorHostnameHere,8080,/json.htm?type=command¶m=updateuservariable&vname=YourUserVariableHere&vtype=2&vvalue=%ip%
SendToHTTP DomoticzIPorHostnameHere,8080,/json.htm?type=command¶m=udevice&idx=123456789&nvalue=0&svalue=%ip%
timerSet,1,3600 //Set Timer 1 for the next event in x seconds
endon
On Rules#Timer=1 do //When Timer1 expires, do
SendToHTTP DomoticzIPorHostnameHere,8080,/json.htm?type=command¶m=updateuservariable&vname=YourUserVariableHere&vtype=2&vvalue=%ip%
SendToHTTP DomoticzIPorHostnameHere,8080,/json.htm?type=command¶m=udevice&idx=123456789&nvalue=0&svalue=%ip%
timerSet,1,3600 //Resets the Timer 1 for another x seconds
endon
You need to create a user variable in domoticz with string parameter or/and a text dummy.
Don't forget to change this values in the code, as well as Domoticz IP or hostname and port.
You need to be careful with this rules because when you update it in the ESP there's a bug with the "¶m" becoming "¶m" so every time you change something in this rules you need to update this.
-------------------edit------------------
workaround for the ¶m issue:
Code: Select all
On System#Boot do //When the ESP boots, do
SendToHTTP DomoticzIPorHostnameHere,8080,/json.htm?param=updateuservariable&type=command&vname=YourUserVariableHere&vtype=2&vvalue=%ip%
SendToHTTP DomoticzIPorHostnameHere,8080,/json.htm?param=udevice&type=command&idx=123456789&nvalue=0&svalue=%ip%
timerSet,1,3600 //Set Timer 1 for the next event in x seconds
endon
On Rules#Timer=1 do //When Timer1 expires, do
SendToHTTP DomoticzIPorHostnameHere,8080,/json.htm?param=updateuservariable&type=command&vname=YourUserVariableHere&vtype=2&vvalue=%ip%
SendToHTTP DomoticzIPorHostnameHere,8080,/json.htm?param=udevice&type=command&idx=123456789&nvalue=0&svalue=%ip%
timerSet,1,3600 //Resets the Timer 1 for another x seconds
endon
"I never make the same mistake twice. I make it like five or six times, you know, just to be sure."