I would like to see how much time my condition is on. The problem is the it has 3 states.
heat-cool-dry. Can I have 1 sensor only depending on the modes?
I have the following code but this way I have to make 3 different sensors
Is there a way to combine them ?
- platform: history_stats
name: Climate Living Room
entity_id: climate.living_room_ac
state: 'dry'
type: time
end: '{{ now().replace(hour=0, minute=0, second=0) }}'
duration:
hours: 48 # Last 48 hours
Thanks, I am testing it right now. Can you suggest what kind of card it would be better to use to see the results in hours-minutes eg 5h 15 min or 05:15?
I am using a history graph card but I don’t think it will be convenient.
I deleted the (#)binary_sensor because I have this line of code in front of other binary sensors
in config file I have
sensor: !include_dir_merge_list sensors/
this is working ok because I have a few sensors and they are all reporting their values correct
I hope that you don’t need my complete config file because I have to transfer a lot of passwords in secrets.yaml and I can’t right now
I’ve just been reading about the hystory_stats sensor, it uses the recorder database to generate the state so my theory above about requiring a state change is incorrect.
Make sure the entity id in the dev tools states menu matches the one you used in the history stats sensor.
That would be probably the case! I have limited the recorder to what I need to see and keep the database small. I will added later when I return home and let you know.
(I would never thought of that)
thanks again!
After a few days I can report that it is working but not in the way I desired.
for example:
right now the device is on.
the time counter is showing the same value, that was valid before I turned on the device. eg 2h
if I turn off the device again the value is 2h. Sometime (I think at 00:00 ?) it will show the new value eg 6h
It makes sense I guess but I would prefer something like a stopwatch for the particular device.