Python access to the Forecast device

Posted on
Fri Mar 22, 2024 6:01 am
pnm offline
Posts: 57
Joined: Dec 03, 2014
Location: Yorkshire, UK

Python access to the Forecast device

I've created a day zero forecast device called WeatherToday which appears to be working. I can't get the syntax right to get the max temperature in a script.

I would have thought it would be indigo.devices["WeatherToday"].tempmax but its not.

What is the correct syntax?

Posted on
Fri Mar 22, 2024 10:21 am
racarter offline
User avatar
Posts: 480
Joined: Jun 18, 2016
Location: North Yorkshire, UK

Re: Python access to the Forecast device

Code: Select all
weather = indigo.devices[12345678]
value_you_want = weather.states["tempmax"]

Posted on
Fri Mar 22, 2024 11:40 am
pnm offline
Posts: 57
Joined: Dec 03, 2014
Location: Yorkshire, UK

Re: Python access to the Forecast device

Thanks

Posted on
Sat May 11, 2024 11:54 am
pnm offline
Posts: 57
Joined: Dec 03, 2014
Location: Yorkshire, UK

Re: Python access to the Forecast device

I've setup two triggers on the Maximum Temperature so set and unset a boolean variable, but they don't appear to be firing even though tempmax is over 20c.

Have I done something wrong?
Attachments
Screenshot 2024-05-11 185601.png
Screenshot 2024-05-11 185601.png (15.51 KiB) Viewed 81 times
Screenshot 2024-05-11 185105.png
Screenshot 2024-05-11 185105.png (13.61 KiB) Viewed 85 times

Posted on
Sun May 12, 2024 8:33 am
kw123 offline
User avatar
Posts: 8375
Joined: May 12, 2013
Location: Dallas, TX

Re: Python access to the Forecast device

A I would not use a . in a name. It has a special function in python. It will likely work but …
Use a _ instead.

Your trigger is „becomes“ not „is“
I guess you need to wait until it goes from 17 to 18

Or you set it to 20 to make it happen earlier


Sent from my iPhone using Tapatalk

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests

cron