ESP8266 version here; https://github.com/matbor/esp8266Temps2mqtt
Arduino sketch, grab Onewire Temperature's and publish to a mqtt broker.
Setup
- Change MAC address (if you have multiple Adruinos)
- Change DHCP to static IP address if needed.
- Change MQTT broker, mine is setup as mqtt.localdomain
- The Topic you are publishing to is under charTopic[] If you do change it, the three lines below need to be modified to tell it where to start adding the HEX ROM value of the dalas onewire's (the XXXXXXX part).
- PubSubClient Library
Planned improvements, let me know if you want to do this.
- Specify username/password support, handy for remote sensors (TLS isn't supported),
- Tidy up the topic naming
- Realtime Clock, publish time stamp with temp to JSON topic as well
- Or get the time from a topic you subscribe to
NOTE: My arduino I am using is an etherten from Freetronics.
Thanks for the Help,
acknowledgements..
OneWire DS18S20, DS18B20, DS1822 Temperature Example
The DallasTemperature library can do all this work for you!
And Jarek Sinicki for the help with multiple onewire pins.