Midnitte / Home-AssistantConfig

Configuration for my Home Assistant
0 stars 0 forks source link

Fix Travel Time Unknown value #11

Open Midnitte opened 5 years ago

Midnitte commented 5 years ago

When booting up, the travel time takes awhile to get an updated value and will return 'Unknown'.

Perhaps fix with {{ is_state('switch.source', 'on') }} or something like: {% if is_state('sun.sun', 'above_horizon') %} up {% else %} down {% endif %}

Midnitte commented 5 years ago

{% if is_state_attr('sensor.chris_time_from_work', 'duration', 'unknown') %} {{ (as_timestamp(now()) + 60*60) | timestamp_custom("%I:%M %p", true)}} {% else %} {{ (as_timestamp(now()) + states.sensor.chris_time_from_work.attributes.duration | int *60) | timestamp_custom("%I:%M %p", true)}} {% endif %}

Doesn't seem to work as intended...

Midnitte commented 5 years ago

Seems like the fix would involve using if statements to check if the sensor is unknown and creating dummy sensors that set the time either to the sensor time, or to some value (e.g. 60 minutes)...

Not sure if this is worth fixing since it should only ever be unknown for a few minutes at most?