-
Notifications
You must be signed in to change notification settings - Fork 47
Description
I have had some issues in the past with tags falling of the network and lately even the AP just stop working.
The AP is the "Nic" version with a screen, the screen goes black but there is still a blue LED on.
I started looking through all the logs and entities to figure out what could be the cause. What I found might just be an issue with my hardware and/or software but I believe you could benefit from setting up your automations and hardware this way.
Hardware needed: AP, tags and a smart plug.
The smart plug is there to power cycle the AP in case it becomes stale.
The automation to "reset" the AP is as follows:
It triggers if the uptime is frozen for more than 5 minutes.
Cycles the AP.
Waits for the AP to report back (wait for trigger).
Then it finds all automations that start with automation.display
(which is what I named all my automations) and triggers each with 2 minutes delay between them. Just to make sure we don't create a big queue. If this takes a few minutes then that is still not an issue for me.
Rather that than having to do things manually.
alias: E-paper reload automations
description: ""
triggers:
- trigger: state
entity_id:
- sensor.openepaperlink_ap_uptime
for:
hours: 0
minutes: 5
seconds: 0
conditions: []
actions:
- action: switch.turn_off
metadata: {}
data: {}
target:
entity_id: switch.epaper_ap
- delay:
seconds: 10
- action: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.epaper_ap
- wait_for_trigger:
- trigger: state
entity_id: sensor.openepaperlink_ap_uptime
continue_on_timeout: false
- repeat:
for_each: >-
{{ states | selectattr('entity_id', 'search', 'automation.display')
|map(attribute ='entity_id') | list }}
sequence:
- action: automation.trigger
metadata: {}
data:
skip_condition: true
target:
entity_id: "{{ repeat.item }}"
- delay:
minutes: 2
mode: single
Automations that might send multiple images in a short while has been set up so that they do not send more than one at the time.
I noticed my tag that displays the toothbrush battery always failed if there was two or more pending updates.
So I make sure the automation does the waiting and it's set up in queued mode
The automation triggers on battery updates on the toothbrush, or when the tag has reconnected to the AP. quack3d posted how to do that
The battery of my toothbrush is bad, that is why I have a 65% low battery warning, and also why the battery symbol is converted to show less than it's battery value.
So when tag connects it clears pending first to remove old images, then it makes sure there is no queue of pending updates, if there is set this automation in wait for trigger, else send the image to the tag
alias: Display Ladda tandborsten
description: ""
triggers:
- trigger: state
entity_id:
- sensor.io_series_6_7_56c9_battery
- trigger: state
id: first
entity_id:
- sensor.0000021a7d163b1d_wakeup_reason
to:
- FIRSTBOOT
- WDT_RESET
conditions: []
actions:
- if:
- condition: numeric_state
entity_id: sensor.0000021a7d163b1d_pending_updates
above: 0
- condition: trigger
id:
- first
then:
- action: open_epaper_link.clear_pending
metadata: {}
data: {}
target:
device_id: 1bcbfbaa5e56a0a1fb690f2cbfb67d25
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- if:
- condition: numeric_state
entity_id: sensor.0000021a7d163b1d_pending_updates
above: 0
then:
- wait_for_trigger:
- trigger: state
entity_id:
- sensor.0000021a7d163b1d_pending_updates
to: "0"
for:
seconds: 20
continue_on_timeout: false
enabled: true
- action: open_epaper_link.drawcustom
target:
entity_id:
- open_epaper_link.0000021A7D163B1D
device_id: 1bcbfbaa5e56a0a1fb690f2cbfb67d25
data:
background: white
rotate: 0
payload:
- type: icon
value: toothbrush-electric
x: -21
"y": 0
size: 90
color: Black
- type: icon
value: >-
battery-{{ (((states('sensor.io_series_6_7_56c9_battery')|
int-60)/40) | round(1) *100) | int}}
x: -2
"y": 68
size: 60
color: Black
- type: text
value: "{{ states('sensor.io_series_6_7_56c9_battery') ~ '%'}}"
font: ppb.ttf
anchor: mt
x: 148
"y": >-
{{ 40 if states('sensor.io_series_6_7_56c9_battery') | int > 65 else
10 }}
size: 80
color: >-
{{ 'black' if states('sensor.io_series_6_7_56c9_battery') | int > 65
else 'red' }}
- type: text
value: >-
{{ '' if states('sensor.io_series_6_7_56c9_battery') | int > 65 else
'LADDA' }}
font: ppb.ttf
anchor: mt
x: 148
"y": 85
size: 50
color: red
dry-run: false
mode: queued
max: 3
Even though the battery is 78% the image shows about 50% since it recalculates it to mean 60% is a dead battery.

Since I got everything set up like this there has been no issues at all.
Although it has not been that many days, but the weeks before this has been very rough with more than one tag per day acting up.
So the improvement has been drastic.
EDIT: Oh and thank you very much for this integration. It really is my favourite integration