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 Module

    Scheduled Pinned Locked Moved Requests
    22 Posts 12 Posters 24.6k Views 18 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.
    • A Offline
      Aaron19953 @skippy_oz
      last edited by

      Any chance this will work with https ?
      I’m receive the same error “Error fetching stats”

      I can see the attributes if I browse to
      https://IP:8123/api/states/sensor.name?api_password=PASSWORD

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

        I have it working with HTTPS :grinning_face:

        Change the url to match what you have for HA

        {
            module: 'MMM-homeassistant-sensors',
            position: 'bottom_right',
            config: {
                  url: 'https://username.duckdns.org:8123/api/states',
                  prettyName : 'true',
                  stripName: 'true',
                  values: ["sensor.humidity", "sensor.temperature"]
                }
          },
        

        You will need to modify the node_help.js file for this module change the below line of code /MagicMirror/modules/MMM-homeassistant-sensors/node_helper.js

        request({ url: url, method: 'GET' }, function (error, response, body) {
        

        To the following and change the api-password to what you have set in HA it’s about line 12.

          request({ url: url, headers: {'x-ha-access': 'api-password'}, method: 'GET' }, function (error, response, body) {
        

        It’s working it looks like it takes a bit longer to get the data as I think the atentication takes some time.

        Regards
        skippy_oz

        1 Reply Last reply Reply Quote 0
        • 1
        • 2
        • 3
        • 3 / 3
        • 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