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.

    Home Assistant Sensor

    Scheduled Pinned Locked Moved Utilities
    17 Posts 2 Posters 1.2k Views 2 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.
    • C Offline
      ChrisKelley
      last edited by sdetweil

      Re: MMM-HomeAssistant-Sensors (Development) - Show your HA Sensors on your Mirror
      Hello all
      looking for some help with Home assistant sensor
      I’m getting “Error Fetching Stats” on the Magic Mirror
      My Config is below

       {
                              module: 'MMM-homeassistant-sensors',
                              position: 'bottom_left',
                              config: {
                                      host: "10.10.28.134",
                                      port: "8123",
                                      https: false,
                                      token: "My Token"
                                      values: [
                                              {
                                              sensor: "status.14928_acurite_00275rm_14928_t1",
                                              },
                                              {
                                              sensor: "status.14928_acurite_00275rm_14928_b",
                              },
                      ]
              }
      

      I have tried using a host name instead of the IP address same issue

      If anyone has any thoughts please let me know

      Thanks

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

        @ChrisKelley can you look at the output where you start MM
        if that is pm2, then

        pm2 logs --lines=xxxx
        xxxx is the number of most recent lines, default 15

        on another module to my HA

        [2025-12-03 08:29:00.425] [INFO]  [MMM-HomeAssistantDisplay] [
          'Conected to Home Assistant for module_20_MMM-HomeAssistantDisplay after 0 retries'
        ] 
        

        one other thing, for config and logs, please use a code wrapper around the content

        paste into editor, blank line above and below
        select the text you just pasted, hit the </> button on the editor toolbar above
        or manually
        add a tripple backtic (left of the 1 key on the US keyboard) as the only chars on the line (the blank line above and below)

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • C Offline
          ChrisKelley @ChrisKelley
          last edited by

          Thanks for the fast response… here is the log file

          0|MagicMir | [2025-12-03 13:22:44.738] [LOG]   MMM-homeassistant-sensors - Connection Failed: undefined
          0|MagicMir | [2025-12-03 13:23:11.668] [LOG]   SONOS_UPDATE
          0|MagicMir | [2025-12-03 13:23:35.496] [LOG]   SONOS_UPDATE
          0|MagicMir | [2025-12-03 13:23:38.618] [LOG]   MMM-homeassistant-sensors - Connection Failed: undefined
          0|MagicMir | [2025-12-03 13:23:41.668] [LOG]   SONOS_UPDATE
          0|MagicMir | [2025-12-03 13:23:44.748] [LOG]   MMM-homeassistant-sensors - Connection Failed: undefined
          0|MagicMir | [2025-12-03 13:24:11.668] [LOG]   SONOS_UPDATE
          0|MagicMir | [2025-12-03 13:24:35.713] [LOG]   SONOS_UPDATE
          0|MagicMir | [2025-12-03 13:24:38.845] [LOG]   MMM-homeassistant-sensors - Connection Failed: undefined
          0|MagicMir | [2025-12-03 13:24:41.668] [LOG]   SONOS_UPDATE
          0|MagicMir | [2025-12-03 13:24:44.818] [LOG]   MMM-homeassistant-sensors - Connection Failed: undefined
          0|MagicMir | [2025-12-03 13:24:59.257] [INFO]  Newsfeed-Fetcher: Broadcasting 60 items.
          0|MagicMir | [2025-12-03 13:24:59.258] [INFO]  Newsfeed-Fetcher: Broadcasting 60 items.
          0|MagicMir | [2025-12-03 13:25:03.630] [INFO]  Newsfeed-Fetcher: Broadcasting 30 items.
          0|MagicMir | [2025-12-03 13:25:11.669] [LOG]   SONOS_UPDATE
          
          S C 2 Replies Last reply Reply Quote 0
          • S Do not disturb
            sdetweil @ChrisKelley
            last edited by

            @ChrisKelley based on that error which I can’t see in the code

            I think its one of two things

            ipaddress of HA wrong
            token to HA wrong

            can you set this config option for the module
            debuglogging:true,

            and recapture the log…

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            C 1 Reply Last reply Reply Quote 0
            • C Offline
              ChrisKelley @ChrisKelley
              last edited by

              Ok… So i added the logging line as well as added .local to the url… this changed things see below… Still not working but error on screen is gone

              chris@MagicMirror:~ $ pm2 logs
              [TAILING] Tailing last 15 lines for [all] processes (change the value with --lin                                                                                                                                                                                                                                                                                                                                                           es option)
              /home/chris/.pm2/pm2.log last 15 lines:
              PM2        | 2025-12-03T08:14:38: PM2 log: pid=4758 msg=process killed
              PM2        | 2025-12-03T08:14:38: PM2 log: App [MagicMirror:0] starting in -fork                                                                                                                                                                                                                                                                                                                                                            mode-
              PM2        | 2025-12-03T08:14:38: PM2 log: App [MagicMirror:0] online
              PM2        | 2025-12-03T14:27:30: PM2 log: Change detected on path MagicMirror/c                                                                                                                                                                                                                                                                                                                                                           onfig/config.js for app MagicMirror - restarting
              PM2        | 2025-12-03T14:27:30: PM2 log: Stopping app:MagicMirror id:0
              PM2        | 2025-12-03T14:27:30: PM2 log: App [MagicMirror:0] exited with code                                                                                                                                                                                                                                                                                                                                                            [0] via signal [SIGINT]
              PM2        | 2025-12-03T14:27:30: PM2 log: pid=5225 msg=process killed
              PM2        | 2025-12-03T14:27:30: PM2 log: App [MagicMirror:0] starting in -fork                                                                                                                                                                                                                                                                                                                                                            mode-
              PM2        | 2025-12-03T14:27:30: PM2 log: App [MagicMirror:0] online
              PM2        | 2025-12-03T15:00:50: PM2 log: Change detected on path MagicMirror/c                                                                                                                                                                                                                                                                                                                                                           onfig/config.js for app MagicMirror - restarting
              PM2        | 2025-12-03T15:00:50: PM2 log: Stopping app:MagicMirror id:0
              PM2        | 2025-12-03T15:00:50: PM2 log: App [MagicMirror:0] exited with code                                                                                                                                                                                                                                                                                                                                                            [0] via signal [SIGINT]
              PM2        | 2025-12-03T15:00:50: PM2 log: pid=9835 msg=process killed
              PM2        | 2025-12-03T15:00:50: PM2 log: App [MagicMirror:0] starting in -fork                                                                                                                                                                                                                                                                                                                                                            mode-
              PM2        | 2025-12-03T15:00:50: PM2 log: App [MagicMirror:0] online
              
              /home/chris/.pm2/logs/sonos-out.log last 15 lines:
              1|sonos    | 2025-12-03T12:51:12.492Z INFO Could not find file /home/chris/node-                                                                                                                                                                                                                                                                                                                                                           sonos-http-api/settings.json
              1|sonos    | 2025-12-03T12:51:12.696Z INFO Presets loaded: {
              1|sonos    |   example: {
              1|sonos    |     players: [
              1|sonos    |       { roomName: 'Bathroom', volume: 10 },
              1|sonos    |       { roomName: 'Kitchen', volume: 10 },
              1|sonos    |       { roomName: 'Office', volume: 10 },
              1|sonos    |       { roomName: 'Bedroom', volume: 10 },
              1|sonos    |       { roomName: 'TV Room', volume: 15 }
              1|sonos    |     ],
              1|sonos    |     playMode: { shuffle: true, repeat: 'all', crossfade: false },
              1|sonos    |     pauseOthers: false
              1|sonos    |   }
              1|sonos    | }
              1|sonos    | 2025-12-03T12:51:13.727Z INFO http server listening on 0.0.0.0 port                                                                                                                                                                                                                                                                                                                                                            5005
              
              /home/chris/.pm2/logs/sonos-error.log last 15 lines:
              1|sonos    | Please migrate your code to use AWS SDK for JavaScript (v3).
              1|sonos    | For more information, check the blog post at https://a.co/cUPnyil
              1|sonos    | (Use `node --trace-warnings ...` to show where the warning was crea                                                                                                                                                                                                                                                                                                                                                           ted)
              1|sonos    | (node:985) NOTE: The AWS SDK for JavaScript (v2) is in maintenance                                                                                                                                                                                                                                                                                                                                                            mode.
              1|sonos    |  SDK releases are limited to address critical bug fixes and securit                                                                                                                                                                                                                                                                                                                                                           y issues only.
              1|sonos    |
              1|sonos    | Please migrate your code to use AWS SDK for JavaScript (v3).
              1|sonos    | For more information, check the blog post at https://a.co/cUPnyil
              1|sonos    | (Use `node --trace-warnings ...` to show where the warning was crea                                                                                                                                                                                                                                                                                                                                                           ted)
              1|sonos    | (node:1035) NOTE: The AWS SDK for JavaScript (v2) is in maintenance                                                                                                                                                                                                                                                                                                                                                            mode.
              1|sonos    |  SDK releases are limited to address critical bug fixes and securit                                                                                                                                                                                                                                                                                                                                                           y issues only.
              1|sonos    |
              1|sonos    | Please migrate your code to use AWS SDK for JavaScript (v3).
              1|sonos    | For more information, check the blog post at https://a.co/cUPnyil
              1|sonos    | (Use `node --trace-warnings ...` to show where the warning was crea                                                                                                                                                                                                                                                                                                                                                           ted)
              
              /home/chris/.pm2/logs/MagicMirror-error.log last 15 lines:
              0|MagicMir | [2025-12-03 14:56:32.970] [ERROR] MMM-homeassistant-sensors - build                                                                                                                                                                                                                                                                                                                                                           Url: http://homeassistant.local:8123/api/states
              0|MagicMir | [2025-12-03 14:56:35.439] [ERROR] MMM-homeassistant-sensors - build                                                                                                                                                                                                                                                                                                                                                           Url: http://homeassistant.local:8123/api/states
              0|MagicMir | [2025-12-03 14:57:32.971] [ERROR] MMM-homeassistant-sensors - build                                                                                                                                                                                                                                                                                                                                                           Url: http://homeassistant.local:8123/api/states
              0|MagicMir | [2025-12-03 14:57:35.435] [ERROR] MMM-homeassistant-sensors - build                                                                                                                                                                                                                                                                                                                                                           Url: http://homeassistant.local:8123/api/states
              0|MagicMir | [2025-12-03 14:58:32.971] [ERROR] MMM-homeassistant-sensors - build                                                                                                                                                                                                                                                                                                                                                           Url: http://homeassistant.local:8123/api/states
              0|MagicMir | [2025-12-03 14:58:35.456] [ERROR] MMM-homeassistant-sensors - build                                                                                                                                                                                                                                                                                                                                                           Url: http://homeassistant.local:8123/api/states
              0|MagicMir | [2025-12-03 14:59:32.970] [ERROR] MMM-homeassistant-sensors - build                                                                                                                                                                                                                                                                                                                                                           Url: http://homeassistant.local:8123/api/states
              0|MagicMir | [2025-12-03 14:59:35.446] [ERROR] MMM-homeassistant-sensors - build                                                                                                                                                                                                                                                                                                                                                           Url: http://homeassistant.local:8123/api/states
              0|MagicMir | [2025-12-03 15:00:32.970] [ERROR] MMM-homeassistant-sensors - build                                                                                                                                                                                                                                                                                                                                                           Url: http://homeassistant.local:8123/api/states
              0|MagicMir | [2025-12-03 15:00:35.444] [ERROR] MMM-homeassistant-sensors - build                                                                                                                                                                                                                                                                                                                                                           Url: http://homeassistant.local:8123/api/states
              0|MagicMir | /home/chris/MagicMirror/node_modules/electron/dist/electron exited                                                                                                                                                                                                                                                                                                                                                            with signal SIGINT
              0|MagicMir | [2025-12-03 15:00:52.085] [WARN]  You're using a full whitelist con                                                                                                                                                                                                                                                                                                                                                           figuration to allow for all IPs
              0|MagicMir | [2025-12-03 15:00:55.458] [ERROR] [MMM-Remote-Control] Could not fi                                                                                                                                                                                                                                                                                                                                                           nd main module js file for MMM-homeassistant-sensors-old
              0|MagicMir | [2025-12-03 15:01:35.732] [ERROR] MMM-homeassistant-sensors - build                                                                                                                                                                                                                                                                                                                                                           Url: http://homeassistant.local:8123/api/states
              0|MagicMir | [2025-12-03 15:02:35.439] [ERROR] MMM-homeassistant-sensors - build                                                                                                                                                                                                                                                                                                                                                           Url: http://homeassistant.local:8123/api/states
              
              S 1 Reply Last reply Reply Quote 0
              • S Do not disturb
                sdetweil @ChrisKelley
                last edited by

                @ChrisKelley can you show the end of the error—- build lines

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • C Offline
                  ChrisKelley @sdetweil
                  last edited by

                  Lets see if this is better… When I hit the </> button it moves half the code hard right…

                  @sde/home/chris/.pm2/logs/MagicMirror-error.log last 15 lines:
                  0|MagicMir | [2025-12-03 15:00:35.444] [ERROR] MMM-homeassistant-sensors - build Url: http://homeassistant.local:8123/api/states
                  0|MagicMir | /home/chris/MagicMirror/node_modules/electron/dist/electron exited with signal SIGINT
                  0|MagicMir | [2025-12-03 15:00:52.085] [WARN] You’re using a full whitelist con figuration to allow for all IPs
                  0|MagicMir | [2025-12-03 15:00:55.458] [ERROR] [MMM-Remote-Control] Could not fi nd main module js file for MMM-homeassistant-sensors-old
                  0|MagicMir | [2025-12-03 15:01:35.732] [ERROR] MMM-homeassistant-sensors - build Url: http://homeassistant.local:8123/api/states
                  0|MagicMir | [2025-12-03 15:02:35.439] [ERROR] MMM-homeassistant-sensors - build Url: http://homeassistant.local:8123/api/states
                  0|MagicMir | [2025-12-03 15:03:35.542] [ERROR] MMM-homeassistant-sensors - build Url: http://homeassistant.local:8123/api/states
                  0|MagicMir | [2025-12-03 15:04:35.450] [ERROR] MMM-homeassistant-sensors - build Url: http://homeassistant.local:8123/api/states
                  0|MagicMir | [2025-12-03 15:05:35.449] [ERROR] MMM-homeassistant-sensors - build Url: http://homeassistant.local:8123/api/states
                  0|MagicMir | [2025-12-03 15:06:35.564] [ERROR] MMM-homeassistant-sensors - build Url: http://homeassistant.local:8123/api/states
                  0|MagicMir | [2025-12-03 15:07:35.437] [ERROR] MMM-homeassistant-sensors - build Url: http://homeassistant.local:8123/api/states
                  0|MagicMir | [2025-12-03 15:08:35.680] [ERROR] MMM-homeassistant-sensors - build Url: http://homeassistant.local:8123/api/states
                  0|MagicMir | [2025-12-03 15:09:35.585] [ERROR] MMM-homeassistant-sensors - build Url: http://homeassistant.local:8123/api/states
                  0|MagicMir | [2025-12-03 15:10:35.488] [ERROR] MMM-homeassistant-sensors - build Url: http://homeassistant.local:8123/api/states
                  0|MagicMir | [2025-12-03 15:11:36.010] [ERROR] MMM-homeassistant-sensors - build Url: http://homeassistant.local:8123/api/states
                  tweil

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

                    @ChrisKelley did you change the config to .local??

                    Can you ping that from the MagicMirror system

                    i have grandson duty for 2 hours now
                    Then I will install that module

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    C 1 Reply Last reply Reply Quote 0
                    • C Offline
                      ChrisKelley @sdetweil
                      last edited by

                      @sdetweil

                      Yep that works…

                      chris@MagicMirror:~ $ ping 10.10.28.134
                      PING 10.10.28.134 (10.10.28.134) 56(84) bytes of data.
                      64 bytes from 10.10.28.134: icmp_seq=1 ttl=64 time=0.027 ms
                      64 bytes from 10.10.28.134: icmp_seq=2 ttl=64 time=0.032 ms
                      64 bytes from 10.10.28.134: icmp_seq=3 ttl=64 time=0.029 ms
                      64 bytes from 10.10.28.134: icmp_seq=4 ttl=64 time=0.062 ms
                      64 bytes from 10.10.28.134: icmp_seq=5 ttl=64 time=0.036 ms
                      64 bytes from 10.10.28.134: icmp_seq=6 ttl=64 time=0.035 ms
                      64 bytes from 10.10.28.134: icmp_seq=7 ttl=64 time=0.022 ms
                      64 bytes from 10.10.28.134: icmp_seq=8 ttl=64 time=0.022 ms
                      64 bytes from 10.10.28.134: icmp_seq=9 ttl=64 time=0.025 ms
                      64 bytes from 10.10.28.134: icmp_seq=10 ttl=64 time=0.025 ms

                      code_text
                      
                      S C 2 Replies Last reply Reply Quote 0
                      • S Do not disturb
                        sdetweil @ChrisKelley
                        last edited by

                        @ChrisKelley ping by name?

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        1 Reply Last reply Reply Quote 0
                        • C Offline
                          ChrisKelley @ChrisKelley
                          last edited by

                          Yep sorry that makes more sense

                          chris@MagicMirror:~ $ ping homeassistant.local
                          PING homeassistant.local (10.10.28.211) 56(84) bytes of data.
                          64 bytes from 10.10.28.211 (10.10.28.211): icmp_seq=1 ttl=64 time=2.91 ms
                          64 bytes from 10.10.28.211 (10.10.28.211): icmp_seq=2 ttl=64 time=3.81 ms
                          64 bytes from 10.10.28.211 (10.10.28.211): icmp_seq=3 ttl=64 time=4.07 ms
                          64 bytes from 10.10.28.211 (10.10.28.211): icmp_seq=4 ttl=64 time=3.88 ms
                          64 bytes from 10.10.28.211 (10.10.28.211): icmp_seq=5 ttl=64 time=1.18 ms
                          64 bytes from 10.10.28.211 (10.10.28.211): icmp_seq=6 ttl=64 time=3.95 ms
                          64 bytes from 10.10.28.211 (10.10.28.211): icmp_seq=7 ttl=64 time=4.10 ms
                          64 bytes from 10.10.28.211 (10.10.28.211): icmp_seq=8 ttl=64 time=1.52 ms

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

                            @ChrisKelley no issue, it’s useful as we know it generates the same address

                            Sam

                            How to add modules

                            learning how to use browser developers window for css changes

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

                              @ChrisKelley so I installed, did npm install in the module folder
                              here is my config , two sensors from my entities list in HA

                              so now all I can think is your token string is bad…

                                    {
                                        module: 'MMM-homeassistant-sensors',
                                        position: 'top_left',
                                        classes: "page4",
                                        config: {
                                          host: "homeassistant.local",
                                          port: "8123",
                                          https: false,
                                          token: " my fresh token ",
                                          values: [
                                            {
                                              sensor: "binary_sensor.athom_garage_door_status",
                                            },
                                            {
                                              sensor: "sensor.foo_battery_percentage",
                                            },
                                          ]
                                        }
                                    },
                              

                              Sam

                              How to add modules

                              learning how to use browser developers window for css changes

                              1 Reply Last reply Reply Quote 0
                              • C Offline
                                ChrisKelley @sdetweil
                                last edited by

                                @sdetweil
                                Sam
                                Thank you for all the help… I tried deleting the token. I made a new token in HA and used that one still nothing… I deleted the module from MM and I will try again this afternoon. Which fork did you use for your test? There are at least two just want to make sure I use the same one as you did…
                                Thanks
                                Chris

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

                                  @ChrisKelley I used this one

                                  https://github.com/Snille/MMM-homeassistant-sensors.git

                                  Sam

                                  How to add modules

                                  learning how to use browser developers window for css changes

                                  C 1 Reply Last reply Reply Quote 0
                                  • C Offline
                                    ChrisKelley @sdetweil
                                    last edited by

                                    @sdetweil

                                    SAM!!!
                                    Thank You!! It works… I was using a different fork then the one you used… plus I think my sensor strings were malformed. but all good now!

                                    Thank You Again!

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

                                      @ChrisKelley woohoo… great news… thanks for the feedback!!

                                      Sam

                                      How to add modules

                                      learning how to use browser developers window for css changes

                                      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