I’ve searched, I see other people with similar thing but no great fix.
My Shelly Flood Gen 4’s show unavailable. They are doing what they are supposed to do in zigbee mode. Is a battery saving thing when they go to sleep. They come on and report for a few then back to sleep, wake up immediately when moisture is detected etc. when they sleep I get “unavailable” for both the battery, and wet/dry state.
Is there a fix to show what the last state was instead? I was thinking about using a helper or something to save and view the last known state instead of the current state. Cant seem to find anything in helpers though.
Am using the Home Assistant Connect ZBT-2. I could change them to matter over wifi, or wifi direct with them but I think Zigbee is the best option for battery reservation.
I found a HACS fix.
“Previous State Tracker”
I wont describe a how to here because I’m still figuring it out myself but I have a constant entity in my dashboard now that doesn’t show “unavailable”.
The "previous state Tracker" didn't work out in the long term. I never quite figured it out. it sometimes worked, sometimes didn't had to restart etc. Maybe was my ignorance or a translation issue (I think the developer is Russian so the instructions are difficult for me).
Anyhoo...
I created an automation that sets a text helper, then I could create an entity card pointed to the helper.
That seems to work much better.
In the automation, you can set a value template to ignore unavailable and unknown.
so...
-create a "input text" helper for each entity.
-then create an automation to pull from the Shelly, Flood's entity, filter the unavailable or whatever with the "not in" command in the automation and sent to the helper.
point your deshboard entity card to the new helper.
alias: auto_Shelly_Flood_HotWater_sensor
description: Saves the current Shelly Flood state to an Input Text helper on state change
triggers:
- entity_id: binary_sensor.shelly_flood_hotwater_sensor
trigger: state
conditions:
- condition: template
value_template: >-
{{ trigger.to_state.state | default('unknown') not in ['unavailable',
'unknown', 'idle', 'standby'] }}
actions:
- action: input_text.set_value
target:
entity_id: input_text.helper_shelly_hotwater_floodsensor
data:
value: >-
{% set state = trigger.to_state.state | default('off') %} {{ 'Wet' if
state == 'on' else 'Dry' }}
mode: single