Find out device's IP address, starting from DeviceName
Posted: Tuesday 08 October 2019 15:13
Setup as example
A smart plug with Tasmota, fixed IP-address and Idx from Domoticz: plug is also created as a switch in Domoticz so has a device name and Idx
mqtt plugin is enabled (mosquitto). I can pilot the plug from domoticz, or by pushing the button on the plug itself
As it's wifi, things can go wrong, and domoticz might claim plug is on, but not in real life.. (and I have a dozen or so devices around the house)
I want to build a generic function that checks real status of a given "device name" by querying the device itself.
And then take appropriate action(s).
For this I need to know how to retrieve the IP-address of the plug itself (I'd rather not make a list of IPs)
The command for real status retrieval is simple: http://192.168.178.77/cm?&user=xxxx&pas ... mnd=Power1
and I can already parse the json output.
Problem: I know how to go from device name to device ID
but how to go from either of those to the IP-address ?
I searched but so far failed to see where in domoticz is the link between Idx and IP-address - I guess it's in the mqtt plugin
Thanks for reading, and for any help you could provide !
A smart plug with Tasmota, fixed IP-address and Idx from Domoticz: plug is also created as a switch in Domoticz so has a device name and Idx
mqtt plugin is enabled (mosquitto). I can pilot the plug from domoticz, or by pushing the button on the plug itself
As it's wifi, things can go wrong, and domoticz might claim plug is on, but not in real life.. (and I have a dozen or so devices around the house)
I want to build a generic function that checks real status of a given "device name" by querying the device itself.
And then take appropriate action(s).
For this I need to know how to retrieve the IP-address of the plug itself (I'd rather not make a list of IPs)
The command for real status retrieval is simple: http://192.168.178.77/cm?&user=xxxx&pas ... mnd=Power1
and I can already parse the json output.
Problem: I know how to go from device name to device ID
but how to go from either of those to the IP-address ?
I searched but so far failed to see where in domoticz is the link between Idx and IP-address - I guess it's in the mqtt plugin
Thanks for reading, and for any help you could provide !