Get local IP Address from a known MAC Address in Python?

I am running a Python Script on the Raspberry Pi in order to get measured data out of a Smart Plug. In my script I need to write the IP Address of the Smart Plug so that I can retrieve the data it has measured. The problem is that I need to be able to take the Smart Plug to different places without having to hard code its new local IP-Address every time.

I have the MAC Address so I am hoping there is an easy way to add a couple lines of code and retrieve the local IP-Address from the MAC (?) in the Python Script. Thanks

You’ve posted this to a forum dedicated to Node-RED. Perhaps you’d have more luck if you posted it to a forum that’s is focussed on python?

1 Like