ikea-led-obegraensad icon indicating copy to clipboard operation
ikea-led-obegraensad copied to clipboard

Adding MQTT control and new weather features

Open robotfishe opened this issue 1 year ago • 2 comments

This PR adds the ability to show forecast as well as current weather. It uses two new variables: weatherMode and weatherTime. weatherMode can be set to 0 (current), 1 (hourly forecast), or 2 (daily forecast); weatherTime sets the number of hours or days to look ahead. For example, if you want the forecasted weather one hour from now, set both weatherMode and weatherTime to 1.

I am not confident of my ability to edit the web GUI, so for now these settings can only be changed via websocket or the second contribution in this PR: MQTT control.

Three MQTT settings are currently available. Topics are "Obegraensad/mode" (changes the plugin), "Obegraensad/weatherMode", and "Obegraensad/weatherTime" (as above). Messages must be integers.

This PR also splits the weather loop into a tick-tock setup, getting updated JSON data on one loop and parsing it on the next, to avoid CPU watchdog timeouts.

robotfishe avatar Dec 16 '23 23:12 robotfishe

It got cold enough here this week that I noticed an issue with how the weather plugin manages negative numbers - now fixed.

robotfishe avatar Jan 17 '24 21:01 robotfishe

@robotfishe The whole PR is messed up. Please do one with proper commit history and one pr per feature - you simply cant keep track.. I had trouble yesterday implementing your solution because it looks like some things are specifically just implemented for esp8266 instead of making it available for both esp32 and esp8266. So i looked into your code and just merged your MQTT support in my local workspace.

OldDroid avatar Jan 21 '24 09:01 OldDroid

mqtt support would be nice. Any plans to continue on this PR?

mrueg avatar Oct 16 '24 12:10 mrueg

mqtt support would be nice. Any plans to continue on this PR?

Not after the attitude I got from OldDroid in that last comment. Feel free to download my files and see if they work for you, and I'm happy to answer any questions.

robotfishe avatar Oct 16 '24 12:10 robotfishe