Send IP address to mqtt

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
goczen
New user
Posts: 3
Joined: 21 Oct 2016, 18:25

Send IP address to mqtt

#1 Post by goczen » 21 Oct 2016, 18:31

Hi
Could you tell me, how I can send the %ip% to mqtt broker, I can send other datas like the temperature and analog input.
thank you

mgennip
Normal user
Posts: 22
Joined: 17 Jun 2016, 19:22

Re: Send IP address to mqtt

#2 Post by mgennip » 21 Oct 2016, 19:07

This can only done if you can add some code to the mqtt plugin and compile the firmware yourself. Sending %ip% is not a standard feature. I would like to see this implemented also in the generic http plugin

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Send IP address to mqtt

#3 Post by papperone » 21 Oct 2016, 20:59

You can send it at boot or at a given interval using events.
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

goczen
New user
Posts: 3
Joined: 21 Oct 2016, 18:25

Re: Send IP address to mqtt

#4 Post by goczen » 22 Oct 2016, 01:20

thanks a lot
I put it in the rules section and it works:

On System#Boot do //When the ESP boots, do
Publish /%sysname%/Bedroom/IPAddress,%ip%
timerSet,1,600 //Set Timer 1 for the next event in 10 minutes
On Rules#Timer=1 do //When Timer1 expires, do
Publish /%sysname%/Bedroom/IPAddress,%ip%
timerSet,1,600 //Set Timer 1 for the next event in 10 minutes

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Send IP address to mqtt

#5 Post by papperone » 22 Oct 2016, 01:24

good to be helpful :)
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

f-fish
New user
Posts: 9
Joined: 19 Sep 2016, 04:11
Location: Johannesburg - RSA
Contact:

Re: Send IP address to mqtt

#6 Post by f-fish » 23 Oct 2016, 15:05

Thanks that is useful,

Would be cool to have both %sysname% and %ip% as part of http://www.esp8266.nu/index.php/SysInfo

Later Ferdie

Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 12 guests