Snille / MMM-homeassistant-sensors

Shows home assistant sensors on the Magic Mirror.
MIT License
63 stars 15 forks source link

Error fetching stats #13

Open b-reich opened 1 year ago

b-reich commented 1 year ago

Hi, I am currently unable to get the plugin to work. Maybe someone has an Idea.

grafik

config:

        {
            module: 'MMM-homeassistant-sensors',
            position: 'top_left',
            config: {
                host: "homeassistant.lan",
                port: "8123",
                https: true,
                token: "my-token",
                values: [
                    {
                        sensor: "sensor.schreibtisch_steckdose_energy",
                    },
                ]
            }
        },
cedricdirr commented 1 year ago

same here, I don't understand the issue yet, and cannot see anything on the logs.

b-reich commented 1 year ago

@cedricdirr same here...

P11x3l commented 1 year ago

I'm far from a coding guru but removing part of the error checking has made this work for me.

MMM-homeassistant-sensors.js Line 125 if (data && !this.isEmpty(data)) { Change Line 125 TO if (data) {

Using browser debug console we can see 'data' contains results from HA, so something with the isEmpty() isn't working correctly.

Snille commented 2 months ago

Hi, I have completely missed all the issues here... Do you guys still have issues? I have pushed a "reworked" version of the "request" part (using fetch instead)... Check out the "dev" branch...

b-reich commented 2 months ago

I can give it a shot at the weekend

b-reich commented 1 month ago

Sorry, for my late response.

I had some time to test it. No change for me.

https: true, can it handle a self singed cert?

Snille commented 1 month ago

Ah, ok. I have not tested that bit. :) Not sure if I can fix it... Never tried out the https parts actually, it's from the original "fork"... :) I'm not using a cert "internally"...

b-reich commented 1 month ago

Adding (self singed) certs to electron/node is a bit painful..

It would be helpful to have some logging output at this point