@Hellis81 wrote:
I tried last night to create a dynamic attribute name with the temperature as the value but it didn’t work.
Then I found a post here saying it can’t be done without pythonSo how can I save 24 hours of weather temperature?
I need to have this data easily accessible since I want to output it on a MAX7219 8 bit display, something like temperature now and temperature say 5 hours ago.
As far as I have managed to google it’s not easily accessible in the history database, so that is why I thought I could just save it in an entity.
Since this doesn’t work:customizer.set_attribute entity_id: input_text.text1 attribute: now().hour value: 5
I assume I need some if, elseif to set the attribute name (?), but is that possible?
Can I break it up something like this?customizer.set_attribute entity_id: input_text.text1 if(now().hour == 0) attribute: "0"; if(now().hour == 1) attribute: "1"; .... .... value: 5
My hope is that it will work in an automation that runs every hour.
Posts: 9
Participants: 4