Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 99175

Input_datetime as offset for sun event trigger

$
0
0

@Sparks wrote:

Fellow HA´ers,
As a last resort, I need your help on the below:
I am extensively using sunset and sunrise as triggers for various automations. I use the UI to configure automations, and have the offset for my automations “hardcoded” in the UI for automations. In order for my wife to change certain settings, I want the offset´s to be accesible by using a helper, which can be changed through a card on lovelace.

Here is my code in automation.yaml:

- id: '1590563700083'
  alias: TEST use Helper Input time for offset sun event
  description: TEST use Helper Input time for offset sun event
  trigger:
  - event: sunset
    offset: "{{ states('input_datetime.test_input_time') }}"
    platform: sun
  condition: []
  action:
  - data:
      message: Test Notification triggered by sunset with offset
    service: notify.mobile_app_iphone_john

The Developer Tools - Templates shows the correct value which was set:
-------------screenshot-------------

But when I do the configuration check, I get the following error:

Invalid config for [automation]: offset {{ states(‘input_datetime.test_input_time’) }} should be format ‘HH:MM’ or ‘HH:MM:SS’ for dictionary value @ data[‘trigger’][0][‘offset’]. Got None.

I am afraid I get either stuck in the Quote tombola, or offset for sun can simply not be given as an input like this.

Any help, much appreciated.
Kind regards,
John

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 99175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>