@WoJWoJ wrote:
I use Home Assistant coupled with App Daemon for the automations.
I currently have automations of the style “30 minutes before sunset, switch on the lights in the living room”. The drawback is that the details are hard-coded: it is always 30 minutes, and every week day.
If I want to change either of these conditions (the number of minutes, or the fact that the automation runs) I have to edit my App Daemon code.
To solve this, I wanted to add to Home Assistant
- an input for the minutes
- a binary input for the execution or not of the automation
- relevant entries in the UI to switch / update them.
and query them from App Daemon to adjust the automation details.
It did not work
This is how I added the inputs:
# configuration/sensor/automated_light.yaml # this is parsed because configuration.yaml has # sensor: !include_dir_merge_list configuration/sensor/ input_number: minutes_before_sunset: name: minutes avant coucher du soleil initial: 30 min: 0 step: 5 mode: box input_datetime: shut_off_lights_when: name: extinction des lumières has_date: false has_time: true input_boolean: shut_off_lights: name: extinction des lumières initial: on icon: mdi:car switch_on_lights: name: allumage des lumières initial: on
and the relevant part in
ui-lovelace.yaml
- entities: - sensor.minutes_before_sunset - sensor.shut_off_lights - sensor.shut_off_lights_when - sensor.switch_on_lights title: Automatisation des lumières type: entities
This gives on the dashboard:
and I cannot find any of the inputs in Development Tools / States
What is the correct way to add such entries?
Posts: 7
Participants: 2