MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Display temperature over network

    Scheduled Pinned Locked Moved General Discussion
    14 Posts 7 Posters 4.9k Views 7 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L Offline
      linuxdxs
      last edited by

      Hello, at first please excuse my bad english. I build a thermometer with an Rasperry zero. The Raspi shout transmit the value over the Network. All Magic Mirror should display the temperature.
      Can someone help me?

      thank you in advance

      S lavolp3L 2 Replies Last reply Reply Quote 0
      • S Do not disturb
        sdetweil @linuxdxs
        last edited by

        @linuxdxs how transmit over network?

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • L Offline
          linuxdxs
          last edited by

          So far I have no idea how to transfer the data. Maybe over udp and phyton?

          S 1 Reply Last reply Reply Quote 0
          • S Do not disturb
            sdetweil @linuxdxs
            last edited by

            @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

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • L Offline
              linuxdxs
              last edited by

              Ok, which webserver would you prefere

              S 1 Reply Last reply Reply Quote 0
              • S Do not disturb
                sdetweil @linuxdxs
                last edited by

                @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

                https://github.com/sdetweil/SampleModule

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • E Offline
                  ember1205
                  last edited by

                  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. :)

                  S 1 Reply Last reply Reply Quote 0
                  • S Do not disturb
                    sdetweil @ember1205
                    last edited by

                    @ember1205 thats another way, but takes more skill to trigger into MM…

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    E 1 Reply Last reply Reply Quote 0
                    • E Offline
                      ember1205 @sdetweil
                      last edited by

                      @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.

                      S 1 Reply Last reply Reply Quote 0
                      • S Do not disturb
                        sdetweil @ember1205
                        last edited by

                        @ember1205 based on @linuxdxs comments and questions, I think starting slow is a better choice…

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        1 Reply Last reply Reply Quote 0
                        • S Offline
                          stampeder
                          last edited by

                          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.

                          1 Reply Last reply Reply Quote 0
                          • P Offline
                            PILuke
                            last edited by

                            @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.

                            D 1 Reply Last reply Reply Quote 2
                            • D Offline
                              davidoesch @PILuke
                              last edited by

                              @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

                              1 Reply Last reply Reply Quote 1
                              • lavolp3L Offline
                                lavolp3 Module Developer @linuxdxs
                                last edited by lavolp3

                                EDIT: Sorry, didn’t read everything.
                                tl;dr: what @stampeder said…

                                @linuxdxs I personally would use MQTT for that purpose. It’s a very lightweight way of regularly publishing data through your network and fetching it with any device you want to. It’s also cross platform. You could use your android mobile as well.

                                I use MQTT to fetch data from and send controls to my tasmota plugs and it works very well.
                                There’s a module called MMM-MQTT-Bridge already published that could be used and my soon-to-be-published MMM-Tasmota would work as well as a basis.
                                On the Raspi’s you would need an MQTT server like mosquitto.
                                May not sound like the easiest way but on the publisher side it’s not more than a few lines of code.

                                How to troubleshoot modules
                                MMM-soccer v2, MMM-AVStock

                                1 Reply Last reply Reply Quote 0

                                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                With your input, this post could be even better 💗

                                Register Login
                                • 1 / 1
                                • First post
                                  Last post
                                Enjoying MagicMirror? Please consider a donation!
                                MagicMirror created by Michael Teeuw.
                                Forum managed by Sam, technical setup by Karsten.
                                This forum is using NodeBB as its core | Contributors
                                Contact | Privacy Policy