Hello everyone,
I just started using hassio and I do have all my homemade sprinkler system (mqtt switches controlling valves). on my previous automation system I was able to read openweathermaps forecast objects and check if there will be a rain in the next 48 hours to skip my watering schedule. I’m not sure how can I achieve that in HA. Here is more detail on my automation.yaml:
- id: '1560827530261'
alias: Switch Walkway Sprinkler
trigger:
- at: 06:00:00
platform: time
condition:
- condition: time
weekday:
- mon
- wed
- fri
action:
- data:
entity_id: switch.walkway_sprinkler
service: switch.turn_on
- delay: 00:15:00
- data:
entity_id: switch.walkway_sprinkler
service: switch.turn_off
as you can see I’m watering my walkway Monday, Wednesday and Friday at 6 AM for 15 minutes.
this automation is working without any issues.
now I want to make it smarter! and skip a watering schedule if there will be a rain in the next 48 hour.
I know that openweathermaps is providing forecast for the next 5 days so could anyone tell me how can I grab that data and check if forecast precipitation object is null for the first two returning objects?
here is what openweathermaps returns:
{
"temperature": 63.7,
"humidity": 93,
"pressure": 30.03,
"wind_bearing": 290,
"wind_speed": 4.7,
"attribution": "Data provided by OpenWeatherMap",
"forecast": [
{
"datetime": 1561658400000,
"temperature": 64.3,
"precipitation": null,
"condition": "sunny"
},
{
"datetime": 1561744800000,
"temperature": 66.4,
"precipitation": null,
"condition": "sunny"
},
{
"datetime": 1561831200000,
"temperature": 68.3,
"precipitation": null,
"condition": "cloudy"
},
{
"datetime": 1561917600000,
"temperature": 68.9,
"precipitation": null,
"condition": "sunny"
},
{
"datetime": 1562004000000,
"temperature": 66.3,
"precipitation": null,
"condition": "sunny"
}
],
"friendly_name": "OpenWeatherMap"
}
anyone can help with this?
I really appreciate any help or guidance
Thank you