I have this automation to turn on outside lights at sunset. Can I include another condition to turn off lights at sunrise. Can it be as one automation?
How can I make this into a 12 hour AM/PM format for the start automation at. I know how to do it for the current time, but not for the input time. My template is coded to show 12 hour time, but the card still displays 24 hours
This value template doesnât make any sense to me, this really works? Your template compares if the time from sensor.time is equal to the time of the converted timestamp from the input_datetime, so it should return either True or False and not a time.
Oh, I overread that you want to change the input_datetime. I donât know and also donât think that this is possible as you would need to change the config of the input_datetime and this has no option for 12AM/PM format.
Maybe, but I donât think so. Maybe you can create the options for the input_select how you want them and then use a value_template to somehow translate your selected value into a readable format for the automation.
For the input_datetime yes, for the input_select you can choose whatever you want, however the automation etc. will not be able to read the value directly, hence the value_template to convert it to a readable format.
So these two automatons donât fire. The lights donât turn on when the sun sets. However, they work when I manually trigger them. I did check that both automations are on in the states page. Maybe itâs best to use entity_id: sun.sun state: below_horizon?
This is how my configuration.yaml file looks like. I have default config in it, but no location.
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
# base_url: example.duckdns.org:8123
# Text to speech
tts:
- platform: google_translate
# Z-Wave Stick
zwave:
usb_path: /dev/ttyACM0
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor: !include sensor.yaml
input_datetime:
set_time:
name: Set Time
has_date: false
has_time: true
Error doing job: Task exception was never retrieved
5:17 PM /usr/src/homeassistant/homeassistant/core.py (ERROR)
Error handling request
1:23 PM /usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py (ERROR) - message first occurred at 1:23 PM and shows up 2 times
remove:Group 'all_scripts' doesn't exist!
10:38 AM components/group/__init__.py (WARNING)
Z-Wave not ready after 300 seconds, continuing anyway
10:37 AM components/zwave/__init__.py (WARNING)
Z-Wave entity Unknown Node 7 Level (node_id: 7) not ready after 31 seconds, continuing anyway
10:33 AM components/zwave/__init__.py (WARNING)
Z-Wave node 7 not ready after 30 seconds, continuing anyway
10:33 AM components/zwave/__init__.py (WARNING)
So the outside lights automation worked last night, but the automation below did not. I checked the state of the input, and it does show the correct set time, but the automation wonât fire. It works only when I manually trigger the automation. The logbook does not show that the automation is triggered.
- id: Set Time
alias: Set Time
trigger:
platform: template
value_template: '{{ state_attr(''input_datetime.set_time'', ''timestamp'') | timestamp_custom(''%I:%M
%p'', False) }}'
action:
- service: light.turn_off
entity_id: group.lightsoff
- service: light.turn_on
entity_id: group.lightson
data:
brightness_pct: 50