Closed achilleus68 closed 4 years ago
Please note that you have issues with the strptime conversion used by the value template (as the stack trace showed). It has nothing to do with the custom card. The card simply checks the state value and if it's not a number will presume verbose_state=true (of the sensor of garbage-collection custom component) and will simply display that string. In this case the state of date_pmd cannot be calculated, throwing error in the log.
I'd check the state of sensor.afval_pmd as that seems unknown.
Thanks for your quick response. I've been playing with the States tool and found the following.
The current settings of sensor.date_pmd are:
next_date: '2020-03-18'
verbose_state: '''true'''
days: '1'
friendly_name: PMD
icon: 'mdi:recycle'
state: 'wordt morgen geleegd'
This results in the following card
As you can see, the state is shown as undefined
When I change only 'days' in the settings, like
next_date: '2020-03-18'
verbose_state: '''true'''
days: '2'
friendly_name: PMD
icon: 'mdi:recycle'
state: 'wordt morgen geleegd'
it results in the following card
So now the state is shown as defined
Apparently when 'days=1' the card does not display the State properly.
Reproduced the fault. Added a fix in the newest release. Please update the card (once it becomes available via HACS) and get back to me with results.
Hi, thanks again for your quick response.
I updated to 1.5.1
~But the results are the same.~ After multiple(!) restarts of HA, it seems to be working OK As of today, days = 0, state is shown as expected
Another sensor now has days=2 and is shown correctly. I will monitor what happens tomorrow
Update: In the HA app (not Ariela but https://play.google.com/store/apps/details?id=io.homeassistant.companion.android) it is still shown as undefined, maybe for mobile a different view is used?
Maybe some sort of cache refresh would be needed for that application (I do not know how it updates the states of sensors).
On more thing I forgot to mention: the card doesn't use verbose_state (as that's an attribute of the garbage-collection custom component sensors), so you could get rid of it in the attribute_templates above.
Ok, everything is working fine, both in web interface and App. Thanks
After updating from 1.4.0 to 1.5.0 the state is shown correctly, until collection day is tomorrow/today, then it just shows 'undefined'
This is the code in my ui-lovelace.yaml
and this is my sensor template
This is the state of the sensor
And there is an error in the logfile,