Snille / MMM-homeassistant-sensors

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

Sensor values appearing as letters #6

Closed pbartko closed 1 year ago

pbartko commented 1 year ago

In my instance of the module, sensor values that are between 0-3 are displayed as letters 'o','n' or 'e'.

image

Here is my config:

          {
            module: 'MMM-homeassistant-sensors',
            position: 'top_left',
            config: {
                host: "192.168.143.64",
                port: "8123",
                fade: 200,
                updateInterval: 60000,
                https: false,
                token: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
                rowClass: 'big',
                values: [
                    {
                        sensor: "sensor.inverter_instant_power",
                        name: "Solar Power",
                        icons: [{
                                "default":"solar-power"
                            }
                        ]   
                    },
                    {
                        sensor: "sensor.inverter_today_yield",
                        name: "Solar Today",
                        icons: [{
                                "default":"solar-power-variant"
                            }
                        ]   
                    },
                    {
                        sensor: "binary_sensor.washingmachineon",
                        name: "Washing Machine",
                        icons: [{
                                "off": "washing-machine-off",
                                "on": "washing-machine"
                                }
                        ],
                        replace: [{
                                "on": "ON",
                                "off": "off"
                            }
                        ],  
                    },
                    {
                        sensor: "binary_sensor.dryeron",
                        name: "Clothes Dryer",
                        icons: [{
                                "off": "tumble-dryer-off",
                                "on": "tumble-dryer"
                                }
                        ],
                        replace: [{
                                "on": "ON",
                                "off": "off"
                            }
                        ],
                    },
                    {
                        sensor: "sensor.ultrasonic_sensor",
                        name: "Rain Barrels",
                        icons: [{
                                "default":"watering-can"
                            }
                        ]
                    },
                    {
                        sensor: "sensor.daily_water",
                        name: "Water Use Today",
                        icons: [{
                                "default":"water-pump"
                            }
                        ]
                    },
                    {
                        sensor: "sensor.senseair_s8_co2_value",
                        name: "CO2 Level",
                        highAlertThreshold:1100,
                        icons: [{
                                "default":"molecule-co2"
                            }
                        ]
                    },
                    {
                        sensor: "sensor.particulate_matter_2_5um_concentration",
                        name: "Air PM2.5 LR",
                        icons: [{
                                "default":"air-filter"
                            }
                        ]
                    },
                /*  {
                        sensor: "sensor.particulate_matter_2_5um_concentration_2",
                        name: "Air PM2.5 BRM",
                        icons: [{
                                "default":"air-filter"
                            }
                        ]
                    },  */
                    {
                        sensor: "binary_sensor.door_sensor_window_door_is_open",
                        name: "Garage Door",
                        icons: [{
                                "default":"garage"
                            }
                        ],
                        replace: [{
                                "on": "Open",
                                "off": "Closed"
                            }
                        ],
                    },
                    {
                        sensor: "binary_sensor.door_sensor_window_door_is_open_2",
                        name: "Shed Door",
                        icons: [{
                                "default":"door-sliding"
                            }
                        ],
                        replace: [{
                                "on": "Open",
                                "off": "Closed"
                            }
                        ],
                    }
                    ]
                }
        },

I've also enabled debugging in the code. Below are the outputs for the image above:

MMM-homeassistant-sensors.js:149 (20) ['0', 'W', {…}, 'none', 'Solar Power', 'none', false, false, '2023-01-10T22:00:05.239545+00:00', undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, null, undefined]

MMM-homeassistant-sensors.js:149 (20) ['3', 'µg/m³', {…}, 'none', 'Air PM2.5 LR', 'none', false, false, '2023-01-10T23:37:52.765769+00:00', undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, null, undefined]

As you can see, the value 0 (Solar Power) is shown as a 'n' and the value 3 (Air PM2.5 LR) is shown as an 'e' in the image above.

Thanks,

Pete

Snille commented 1 year ago

Hi, found the problem. It should now be fixed! Try it and let me know. :) Thank you for finding it!

pbartko commented 1 year ago

The update worked! Thanks for your quick response

pbartko commented 1 year ago

Fix worked, thanks for the update

Pete

On Thu, Jan 12, 2023 at 4:33 PM Erik Pettersson @.***> wrote:

Hi, found the problem. It should now be fixed! Try it and let me know. :) Thank you for finding it!

— Reply to this email directly, view it on GitHub https://github.com/Snille/MMM-homeassistant-sensors/issues/6#issuecomment-1381017935, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIHLG2WQPOVQB53NBK4XZSDWSB2BPANCNFSM6AAAAAATXMZ2HA . You are receiving this because you authored the thread.Message ID: @.***>