Read the statement by Michael Teeuw here.
Display temperature over network
-
@linuxdxs what is running on the pi 0?.. raspian and python?
you could set up a little web server (using node js and express, or python) and then a module on the Magic Mirror could call that server to get the data
-
Ok, which webserver would you prefere
-
@linuxdxs you can write code to start the web server… node web server using express library is very short…
I don’t know python that well… I’m sure a google search will give u results…so, whatever u feel more comfortable with
once u set that up you can use your browser to invoke the function on the pi0 to return the temp…
once that is working, then u can build a module to do the same…
using my sample module might help on the last step -
Why not write the module that goes into MM and then use a script on the thermometer to update the module when the temp changes? If your thermometer is measuring the internal temp of a home, and that changes infrequently because the heat or AC is on, there’s no point in polling the thermometer every five minutes to see what the temp is. :)
-
@ember1205 thats another way, but takes more skill to trigger into MM…
-
@sdetweil Agreed. And, it would still require a method for the module to “register” with the remote thermometer of its existence when it loads so that initial temp and updates will be transmitted.
-
@ember1205 based on @linuxdxs comments and questions, I think starting slow is a better choice…
-
If you are using the Raspberry Pi Zero W’s they come with wifi built in. I just finished getting the MMM-temp-DS18B20 module issue fixed and working. The next thing would be to use MMM-MQTT. This will allow you to have a broker that will collect all the readings and store them in a set of topics. Then you just need the MMM-MQTT-client to read the topics and display the readings. It sounds way more complicated than it really is. I recently wrote a blog posting on http://www.desert-home.com/ called http://www.desert-home.com/2020/02/temperature-adventures-with-rasppi.html. It explains a lot of it. Then you just need to setup the MQTT-clients to read the temperatures. Good luck. Should be a fun project.
-
@linuxdxs you can use this simple module MMM-RemoteTemperature and from your termometer you only send an HTTP POST request.
You choose the udate interval and all the MM, with this module, will update their value when you send the HTTP POST.
I hope this help you. -
@PILuke yep
Had the same challenge
3 DHT sensors on 2 different PIs
solution
on the PI’s I have a cron job wich runs a python program to extract temperature and send it via REST to a MMM-remote temperature
pseudo code json to send
data = {'temp': round(temperature, 1), 'humidity': round(humidity, 0), 'sensorId': str(SensorID)} post_request(json.dumps(data), 'http://192.168.x.x:8080/remote-temperature', {'Content-type': 'application/json', 'Accept': 'text/plain'})
installed MMM-RemoteTemperature, 3 ids
module: 'MMM-RemoteTemperature', position: 'bottom_center', config: { sensorId: '1', icon: 'home', showTime: false } }, { module: 'MMM-RemoteTemperature', position: 'bottom_center', config: { sensorId: '2', icon: 'couch', showTime: false } }, { module: 'MMM-RemoteTemperature', position: 'bottom_center', config: { sensorId: '3', icon: 'map-marker-alt', showTime: false } },
cheers