Hello …
i have a helper in HA Named “input_datetime.anzuchtbox_licht_startzeit”
how to get the hour component from this time select frontend as a int or float in my ESPHome
i try something like this and it doesnt work please help
i have no Problems with Arduino Staff but ESPhome kills me
Hello …
i dont know if the HA Type input_datetime have to tranfer as Textsensor or number sensor to Esphome
cant find any usefull docs.This is my time frontend
[19:01:56][D][homeassistant.text_sensor:015]: 'input_datetime.start_time::hour': Got attribute state '9'
[19:01:56][D][text_sensor:067]: 'starttime': Sending state '9'
[19:01:56][D][main:061]: starttime hour value is: 9
[19:01:56][D][homeassistant.sensor:022]: 'input_datetime.start_time::hour': Got attribute state 9.00
[19:01:56][D][sensor:127]: 'starttimenum': Sending state 9.00000 with 1 decimals of accuracy
[19:01:56][D][main:070]: starttime hour value is: 9.000000
The interval also works:
interval:
- interval: 10sec
then:
- lambda: |-
float f = atof(id(starttime).state.c_str());
ESP_LOGD("main", "Value of my sensor: %f", f);
Result:
[19:17:04][D][main:078]: Value of my sensor: 9.000000
[19:17:14][D][main:078]: Value of my sensor: 9.000000
[19:17:24][D][main:078]: Value of my sensor: 9.000000
[19:17:34][D][main:078]: Value of my sensor: 9.000000
So maybe your problem is on the Home Assistant side. When the text sensor is read from HA you will get a line in the log like:
[19:01:56][D][homeassistant.text_sensor:015]: 'input_datetime.start_time::hour': Got attribute state '9'