I have build garage opener using Fibaro Smart Implant. Outputs are connected to door opener start/stop button and reed switch connected to Smart Implant binary input is used to monitor status of the door. Smart Implant is configured in the way that input works as burglar alarm, so it triggers state change on opening or closing the gate. States reported by Smart Implant are 0 for closed, 2 for opened (and this one changes to 254 after some tim - not sure if to read it as unknown location or deep sleep). Most important is that in stable situation closed gate is always reported as 0 and opened as 2 or 254.
Now, when the hassio is restarted sensor reports value of 254 even if the door is closed. Normally it is never the case for closed gate! I tried to heal network or node, force value refresh by homeassistant.update.entity, adding specific entity to cover template I use for controlling the gate gate but nothing works… Initial state after restart of hassio is always wrong. Any idea how to solve this? So far the only ‘solution’ is to open/close the gate to get it to proper state.
This is normal for many zwave devices. When they go to sleep, they report 254. You should create a template sensor that filters out that state and only use the template sensor for your automations. You may need to tie the state to an input boolean with restore state attached to it so that it can recover from a restart when it’s sleeping.
Well, Smart Implant is always on device (not powered from battery), so I’d not expect it to go to sleep. Just looking at documentation of z-wave alarms at hassio page I found that depending on category of alarm code 254 might have different meaning - it might be either deep sleep or alarm from unknown location.
What is bothering me is that SM changes status to 254 only if the alarm is active. So in normal circumstances it can change from 2 to 254, but never from 0 to 254… at least what I observed from hassio level so far. So why it is reported as 254 when alarm is inactive on hassio restart?
You should create a template sensor that filters out that state and only use the template sensor for your automations.
Actually my template looks at this, but rather not for filtering it out but for merging status 2 and 254 into one (since both represents gate open). Filtering it out would lead to Unknown state… or I’m missing the point?
You may need to tie the state to an input boolean with restore state attached to it so that it can recover from a restart when it’s sleeping.
This is actually the solution I was also thinking of, but since it adds complexity I was checking if there is any other solution… Not sure how to implement this yet (well, I’m still learnig hassio)… Setting input boolean to value to be restored would be easy (simple automation triggered by change of sensor state), but I’m not sure how to restore this state on hassio startup? What I found is homeassistant_start event, but I did not used it yet, so is it the right apprach?
Not entirely sure. Could be a number of reasons. I’d verify that the device isn’t reporting 254 when restarted.
I would only filter it out if it’s going to sleep. If it’s an alarm of some sort then you need to decide if you want to filter it out. Sounds like you already have an idea.
I don’t believe you can with a sensor. Only items tracked by home assistant, i.e. input_xxxx domains.
You wouldn’t need to use this if you built the template sensor to look at an input boolean. Otherwise you can attempt to trigger a sensor update using this homeassistant_start event coupled with homeassistant.update_entity. This approach will be trial and error.