tradithen
(Tradithen)
January 30, 2023, 6:23am
1
Hi !
I’ve setup an automation to start at a specific time:
alias: "auto rug heater on "
description: ""
trigger:
- platform: time
at: input_datetime.rug
- platform: time
at: input_datetime.morning_trigger
condition: []
action:
- service: switch.turn_on
target:
entity_id:
switch.sonoff_100xxxxxxxxxx
data: {}
This specific time is a helper input_datetime
All works fine, until I reboot/restart HA, the helper is reset to 00:00
If it’s relevant, HA is running on a raspberry pi using docker:
docker-compose file (no changes from the standard)
version: "3"
services:
homeassistant:
image: lscr.io/linuxserver/homeassistant:latest
container_name: homeassistant
network_mode: host
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
volumes:
- /volume1/Documents/raspberrypis/docker/ha/config:/config
ports:
- 8123:8123 #optional
restart: unless-stopped
Is that expected behaviour?
Any workarounds?
Thanks in advance,
tom_l
January 30, 2023, 6:41am
2
Do you have the initial
value option set for the input datetime?
If so, remove it.
https://www.home-assistant.io/integrations/input_datetime/#initial
tradithen
(Tradithen)
January 31, 2023, 7:21am
3
I created using the UI, and there’s no such parameter. How can I check / enforce there’s no “initial” then?
tom_l
January 31, 2023, 9:13am
4
Good question. I don’t use the UI so I had no idea. I just had a look at the UI and there is indeed no initial
option.
Looking in Developer Tools → States, in the right hand column, what attributes are listed for your datetime helper?
tradithen
(Tradithen)
January 31, 2023, 9:21am
5
Doesn’t have an initial attribute…
has_date: false
has_time: true
editable: true
hour: 14
minute: 25
second: 0
timestamp: 51900
friendly_name: rug
tom_l
January 31, 2023, 9:22am
6
It could be that the input_datetime is not being restored. Have you excluded it from the recorder database?
tradithen
(Tradithen)
January 31, 2023, 9:48am
7
I didn’t change anything on this.
The odd part is that the “reset” doesn’t always happen… while chatting here, trying to reboot etc… it didn’t happened again…
Let’s pause this thread and I’ll come back when it’s reproducible ?
1 Like
oneAU
(oneAU)
October 28, 2023, 11:49am
8
I got the same issue with two input_datetime helpers.
Their values is set (and never restored) to current time when system restarts.
Did you find an solution?
oneAU
(oneAU)
October 28, 2023, 12:15pm
9
The culprit of my issue was an Automation that got triggered and resulted in a setting of current time.
trigger:
- platform: numeric_state
entity_id: sensor.<some power consumption sensor id>
below: input_number.<some numeric helper id>
action:
- service: input_datetime.set_datetime
data:
timestamp: "{{ now().timestamp() }}"
target:
entity_id: input_datetime.<the timestamp helper being set at system restart>
This gets triggered every time at restart even if the sensor value hasn’t been changed.