Open damianeickhoff opened 8 months ago
Thank you for your work.
To clean up the code for the weather forecast you could edit the following code.
name: '[[[ return states["sensor.weather_forecast_1"].state ]]]'
to:
name: >-
[[[
var days = ['Zon', 'Ma', 'Di', 'Woe', 'Do', 'Vrij', 'Zat'];
var currentDate = new Date(states[entity.entity_id].attributes.forecast[0].datetime);
currentDate.setDate(currentDate.getDate());
return days[currentDate.getDay()];
]]]
It is a little more code, but his makes adding an extra sensor unnecessary and ensures a correct link to the correct weather forecast.
All the code need a pretty good swipe through.