Get the code here :
For more info about installing see this post: http://forum.pimatic.org/topic/1225/espimatic-esp8266-modulair-sensor-for-pimatic/44
Time to stop hijacking this topic http://forum.pimatic.org/topic/329/updated-esp8266-wifi-sensor-temperature-and-humidity and start my own
I have taken parts of the code in the mentioned topic, but did a lot of rewrites. Only part of the layout is kept.
The idea is to build a modulair code for the ESP8266 specifcly for Pimatic. You can turn the modules on or off as you need. Upload once, configure and forget.
- DS18B20 *
- DHTxx *
- Relay *
- 8x8 LED Matrix *
- Infrared transmitter *
- Nixie tubes
- Send commands over HTTP *
- Configure ESP (disable the GPIO’s you have, disabled the ones you don’t)
- Save everything in EEPROM *
- Fallback to AP mode when no wifi config or can’t connect to configured wifi *
Items with * are implemented and working
The idea is to build one code for all you need. Configure the GPIO’s you have and enable the sensors attached to the ESP.
Everything is save in EEPROM: the enabled/disabled sensors and the config for that sensor. WiFi config. Pimatic config.
Over the HTTP ‘api’ you can force a update of temperature. Turn LED Matrix on or off or change the intensity of the LED’s, Turn a relay on or off. Reboot ESP.
On the other side, the ESP will take sensor value and push to pimatic on a desired interval.
There is still a lot of work to do, but maybe I can publish some code soon. At this moment I’m rewriting all the HTML stuff into static HTML with ajax calls. the dynamic HTML pages where pushing the webserver lib to it’s edge causing crashes.
Website with ajax updates:
Boot up and change relay state from pimatic:
Boot up show temperature and alter LED’s
Boot up, fall back to AP mode