Hi community, I need help to troubleshoot my automation.
My Setup:
- Home Assistant Operation System installed on RPi4B and connected to UPS
- relay connected to GPIO 7
I have few chained automations which does not work on home assistant start
- GPIO Sensor
binary_sensor:
- platform: gpiod
sensors:
- name: "GPIO Button 7"
port: 7
active_low: true
debounce: 500
- Automation [1] – State trigger based on GPIO sensor, this automation toggle input_boolean sensor
automation:
- alias: Power Grid State
id: power_grid_state_changed
trigger:
- platform: state
entity_id: binary_sensor.gpiod_gpiod_7_gpio_button_7
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.gpiod_gpiod_7_gpio_button_7
state: "on"
sequence:
- service: homeassistant.turn_on
entity_id: input_boolean.power_grid_state_helper
- conditions:
- condition: state
entity_id: binary_sensor.gpiod_gpiod_7_gpio_button_7
state: "off"
sequence:
- service: homeassistant.turn_off
entity_id: input_boolean.power_grid_state_helper
- Automation [2] – State trigger based on Input Boolean sensor which sends a telegram message
- alias: Power Grid Telegram Notify
trigger:
- platform: state
entity_id:
- input_boolean.power_grid_state_helper
action:
- service: notify.telegram
data:
message: Power State
This automation works fine when Home Assistant is up and running.
But failing when GPIO state was changed offline, so Automation [1] is not triggering despite GPIO sensor reports state change
I was managed to “fix” Automation [1] by adding Home Assistant Started trigger, but the Automation [2] is not triggering.
Any ideas of how to troubleshoot this?