How to add a customized time and binary input?

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 :slight_smile:

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:

image

and I cannot find any of the inputs in Development Tools / States

What is the correct way to add such entries?

currently you don’t need such a thing, just add to your Lovelace card something like

- entity: automation.example

and you’ll be able to enable/disable your automation

these are not sensors. they are input_booleans, input_datetimes etc. check that out.

The automation is not done in HA but in App Daemon. It is the script in App Daemon which will check for the state of this boolean (set though the UI) and decide.

So which “family” do they belong to? So that I can add them to the right directory (via !include_dir_merge_list)

EDIT: ahhh, I understand -they are similar to sensor, so there will be one of each directly in configuration.yaml

Thanks!

Sorry, I’m not familiar with App Daemon. Maybe it’s useful to add an appropriate tag when you create a new topic? :wink:

The automation is just the context (per the first sentence of my question) – but anyways your answer (which I noted as the solution) was what I was missing. Thanks a lot!

1 Like