I have a templating issue, again with SHMI weather forecast.
In Stockholm Sweden we have decent summers, and normally not to cold winters. But we get temperature below 0 Celsius. For this reason most of us have heaters in the car.
Some just to get comfortably warm in the car in the morning (I really hate to scrape the frost from the car window in the morning), some even with an engine heater to spare some life for the engine.
I have made two automations, both is based on Xiaomi (Zigbee) placed in my shed. If it is a weekday and the temperature is below 2 Celsius, I will start the heater at 06:30. If it is below -4, I will start the heater at 06:00.
This is all fine as long as I remembered to connected the cable to the car:-)
So I made an automation that use TTS on my google home when I come home. Basically a few minutes after I come home I play “It’s going to be cold plug in the cable to the car”
This is working, but it has to be based on the weather forecast for tomorrow. The best we have in Sweden is of course the Swedish one, SMHI.
Here is the templating problem.
First let’s look at the entity.
weather.smhi_smhi_huddinge partlycloudy temperature: 8 humidity: 98 pressure: 1016 wind_bearing: 1 wind_speed: 3 visibility: 2.1 attribution: Swedish weather institute (SMHI) forecast: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] cloudiness: 88 friendly_name: SMHI Huddinge
I can get the forecast by templating it looks like this.
{{ states.weather.smhi_smhi_huddinge.attributes.forecast}}
It gives the following data.
[{‘datetime’: ‘2019-10-14T19:00:00’, ‘temperature’: 8, ‘templow’: 7, ‘precipitation’: 0.0, ‘condition’: ‘partlycloudy’}, {‘datetime’: ‘2019-10-15T12:00:00’, ‘temperature’: 9, ‘templow’: 6, ‘precipitation’: 2.0, ‘condition’: ‘rainy’}, {‘datetime’: ‘2019-10-16T12:00:00’, ‘temperature’: 10, ‘templow’: 9, ‘precipitation’: 0.6, ‘condition’: ‘cloudy’}, {‘datetime’: ‘2019-10-17T12:00:00’, ‘temperature’: 9, ‘templow’: 8, ‘precipitation’: 3.0, ‘condition’: ‘rainy’}, {‘datetime’: ‘2019-10-18T12:00:00’, ‘temperature’: 11, ‘templow’: 8, ‘precipitation’: 0.0, ‘condition’: ‘cloudy’}, {‘datetime’: ‘2019-10-19T12:00:00’, ‘temperature’: 12, ‘templow’: 9, ‘precipitation’: 2.4, ‘condition’: ‘cloudy’}, {‘datetime’: ‘2019-10-20T12:00:00’, ‘temperature’: 12, ‘templow’: 9, ‘precipitation’: 1.8, ‘condition’: ‘cloudy’}, {‘datetime’: ‘2019-10-21T12:00:00’, ‘temperature’: 11, ‘templow’: 9, ‘precipitation’: 4.8, ‘condition’: ‘cloudy’}, {‘datetime’: ‘2019-10-22T12:00:00’, ‘temperature’: 10, ‘templow’: 7, ‘precipitation’: 2.4, ‘condition’: ‘cloudy’}, {‘datetime’: ‘2019-10-23T12:00:00’, ‘temperature’: 10, ‘templow’: 8, ‘precipitation’: 1.2, ‘condition’: ‘cloudy’}, {‘datetime’: ‘2019-10-24T00:00:00’, ‘temperature’: 8, ‘templow’: 8, ‘precipitation’: 0.0, ‘condition’: ‘partlycloudy’}]
What I want to use is the “templow” for tomorrow, basically the second “templow” in the list, the first is todays lowest temp, the second one has the ‘datetime’ date for tomorrow. I’m not interested in the day only for tomorrow, or expressed differently the second “templow”.
How do I use this as an condition in an automation?
BR
Tobe