Automation examples - HAEdwin/homeassistant-apsystems_ecu_reader GitHub Wiki
I collected some automations that might help you. The YAML scripts can be copied to the clipboard and simply pasted in the screen where you started a new automation (just press Ctrl+V there). Then you can use the UI of edit the YAML to adapt it to your own entities/devices.
Restart ECU-B or ECU-C
This automation was build for ECU-B and/or ECU-R (2160) owners who use a smart-plug to restart the ECU when it repeatedly refuses connections. When the cache-count is at a certain stage the smart-plug will turn the ECU off and on again after 15 seconds.
alias: Reboot ECU-B when needed
description: ""
triggers:
- trigger: numeric_state
entity_id:
- sensor.ecu_216300123456_using_cache_counter
above: 2
conditions: []
actions:
- action: switch.turn_off
metadata: {}
data: {}
target:
entity_id: switch.smartplug_ecu
- action: persistent_notification.create
metadata: {}
data:
message: ECU-B is being restarted
- delay:
hours: 0
minutes: 0
seconds: 15
milliseconds: 0
- action: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.smartplug_ecu
mode: single