Snille / MMM-homeassistant-sensors

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

error on highAlertThreshold and replace #9

Closed WarLion closed 1 year ago

WarLion commented 1 year ago

just notice the highAlertThreshold and lowAlertThreshold dont work on displayvalue:false and the replace also dont work

Snille commented 1 year ago

Hm, can you provide an example how to test this. I'm not sure I understand what you mean... Explain your use-case so I can replicate. :)

Thank you.

WarLion commented 1 year ago

this is two examples

 {
        sensor: 'sensor.pecera_lizzy_nivel',
        name: 'Nivel Pecera Lizzy',
        displayvalue: false,
        highAlertThreshold: 0.9,
        lowAlertThreshold: 0.0,
        icons: [{
                0: 'arrow-up-bold',
                1: 'arrow-down-bold',
                }],
        }]
},

 {
        sensor: 'sensor.pecera_lizzy_nivel',
        name: 'Nivel Pecera Lizzy',
        displayvalue: true,
        highAlertThreshold: 0.9,
        lowAlertThreshold: 0.0,
        icons: [{
                0: 'arrow-up-bold',
                1: 'arrow-down-bold',
                }],
        }],
        replace[{
                0: 'Llena',
                1:'Vacia'
        }]
},

1.- when using displayvalue: false and highAlertThreshold, the highAlertThreshold and lowAlertThreshold dont work 2.- when using replace the highAlertThreshold and lowAlertThreshold dont work

Snille commented 1 year ago

Ok, I see, I'll have to try and replicate that. :) Thank you for explaining.

Snille commented 1 year ago

Ok! I think I fixed it... :) What i noticed though is that you may have to use quotation marks around the values like this:

 {
        sensor: 'sensor.pecera_lizzy_nivel',
        name: 'Nivel Pecera Lizzy',
        displayvalue: true,
        highAlertThreshold: 0.9,
        lowAlertThreshold: 0.0,
        icons: [{
                "0": 'arrow-up-bold',
                "1": 'arrow-down-bold',
        }],
        replace: [{
                "0": 'Llena',
                "1":' Vacia',
        }]
},

Try it and let me know. :)

WarLion commented 1 year ago

the last commint did it thatnk Snille