Please can someone give me a pointer on how to poll slider widgets when an ESP8266 wakes from sleep? Any help would me much appreciated.
The objective is as follows:
- This is a newbie project to do room temperature balancing. I’m logging temperature data to Cayenne but also want a visual output on the unit itself.
-I’ve got LEDs attached to an ESP8266 that change colour to show whether a DHT11 sensor is within a particular range.
- The ESP8266 sleeps for a while then wakes, takes a reading and sends it to Cayenne, flashes the appropriate LED colour (red too warm, blue too cold) then goes back to sleep.
- I’ve put upper and lower range sliders on my dashboard that I want to use as two variables in my code.
- The hope was that I would be able to tweak the upper and lower temp limits from the dashboard rather than tweaking the code and uploading to the board.
- Moving the sliders works perfectly when the ESP8266 is awake, but if I move them while it’s asleep then the changes aren’t picked up when it wakes. This does make sense based on my limited understanding of MQTT as the subscriber isn’t listening when the change is published and then presumably sent out by the broker.
Progress so far:
- ESP8266 connects to Cayenne, publishes temp and humidity, sleeps, wakes and repeats.
- Any slider changes that I happen to make while the ESP8266 is awake make their way to the ESP8266.
- I looked through the documentation and tried CAYENNE_CONNECTED() and Cayenne.SyncVirtual but then found that these weren’t applicable to MQTT.