Browse Source

Merge remote-tracking branch 'origin/dev' into webui/switch-typo

rules-rpn
Max Prokhorov 5 years ago
parent
commit
58d911d3ed
95 changed files with 19676 additions and 19465 deletions
  1. +101
    -37
      README.md
  2. +1
    -1
      code/espurna/broker.ino
  3. +107
    -94
      code/espurna/config/arduino.h
  4. +1
    -1
      code/espurna/config/general.h
  5. +18
    -57
      code/espurna/config/hardware.h
  6. +1
    -1
      code/espurna/config/sensors.h
  7. BIN
      code/espurna/data/index.all.html.gz
  8. BIN
      code/espurna/data/index.light.html.gz
  9. BIN
      code/espurna/data/index.lightfox.html.gz
  10. BIN
      code/espurna/data/index.rfbridge.html.gz
  11. BIN
      code/espurna/data/index.rfm69.html.gz
  12. BIN
      code/espurna/data/index.sensor.html.gz
  13. BIN
      code/espurna/data/index.small.html.gz
  14. +1
    -1
      code/espurna/encoder.ino
  15. +1
    -1
      code/espurna/filters/BaseFilter.h
  16. +1
    -1
      code/espurna/filters/LastFilter.h
  17. +1
    -1
      code/espurna/filters/MaxFilter.h
  18. +1
    -1
      code/espurna/filters/MedianFilter.h
  19. +1
    -1
      code/espurna/filters/MovingAverageFilter.h
  20. +1
    -1
      code/espurna/gpio.ino
  21. +1
    -1
      code/espurna/homeassistant.ino
  22. +1
    -1
      code/espurna/i2c.ino
  23. +1
    -1
      code/espurna/influxdb.ino
  24. +1
    -1
      code/espurna/ir.ino
  25. +33
    -15
      code/espurna/led.ino
  26. +1
    -1
      code/espurna/llmnr.ino
  27. +1
    -1
      code/espurna/mdns.ino
  28. +1
    -1
      code/espurna/migrate.ino
  29. +1
    -1
      code/espurna/netbios.ino
  30. +1
    -1
      code/espurna/sensors/AnalogSensor.h
  31. +1
    -1
      code/espurna/sensors/BH1750Sensor.h
  32. +1
    -1
      code/espurna/sensors/BMP180Sensor.h
  33. +1
    -1
      code/espurna/sensors/BMX280Sensor.h
  34. +1
    -1
      code/espurna/sensors/BaseSensor.h
  35. +20
    -7
      code/espurna/sensors/CSE7766Sensor.h
  36. +1
    -1
      code/espurna/sensors/DHTSensor.h
  37. +1
    -1
      code/espurna/sensors/DallasSensor.h
  38. +1
    -1
      code/espurna/sensors/DigitalSensor.h
  39. +1
    -1
      code/espurna/sensors/ECH1560Sensor.h
  40. +1
    -1
      code/espurna/sensors/EmonADC121Sensor.h
  41. +1
    -1
      code/espurna/sensors/EmonADS1X15Sensor.h
  42. +1
    -1
      code/espurna/sensors/EmonAnalogSensor.h
  43. +1
    -1
      code/espurna/sensors/EmonSensor.h
  44. +1
    -1
      code/espurna/sensors/EventSensor.h
  45. +1
    -1
      code/espurna/sensors/GUVAS12SDSensor.h
  46. +1
    -1
      code/espurna/sensors/HLW8012Sensor.h
  47. +1
    -1
      code/espurna/sensors/I2CSensor.h
  48. +9
    -16
      code/espurna/sensors/MAX6675Sensor.h
  49. +1
    -1
      code/espurna/sensors/MHZ19Sensor.h
  50. +1
    -1
      code/espurna/sensors/MICS2710Sensor.h
  51. +1
    -1
      code/espurna/sensors/MICS5525Sensor.h
  52. +1
    -1
      code/espurna/sensors/NTCSensor.h
  53. +1
    -1
      code/espurna/sensors/PZEM004TSensor.h
  54. +1
    -1
      code/espurna/sensors/PulseMeterSensor.h
  55. +1
    -1
      code/espurna/sensors/SDS011Sensor.h
  56. +1
    -1
      code/espurna/sensors/SHT3XI2CSensor.h
  57. +1
    -1
      code/espurna/sensors/SI7021Sensor.h
  58. +1
    -1
      code/espurna/sensors/SonarSensor.h
  59. +1
    -1
      code/espurna/sensors/TMP3XSensor.h
  60. +1
    -1
      code/espurna/sensors/V9261FSensor.h
  61. +1
    -1
      code/espurna/sensors/VEML6075Sensor.h
  62. +1
    -1
      code/espurna/sensors/VL53L1XSensor.h
  63. +1
    -1
      code/espurna/ssdp.ino
  64. +3167
    -3154
      code/espurna/static/index.all.html.gz.h
  65. +2605
    -2593
      code/espurna/static/index.light.html.gz.h
  66. +2199
    -2188
      code/espurna/static/index.lightfox.html.gz.h
  67. +2235
    -2223
      code/espurna/static/index.rfbridge.html.gz.h
  68. +4127
    -4115
      code/espurna/static/index.rfm69.html.gz.h
  69. +2706
    -2695
      code/espurna/static/index.sensor.html.gz.h
  70. +2199
    -2188
      code/espurna/static/index.small.html.gz.h
  71. +1
    -1
      code/espurna/system.ino
  72. +1
    -1
      code/espurna/telnet.ino
  73. +1
    -1
      code/espurna/thinkspeak.ino
  74. +1
    -1
      code/espurna/utils.ino
  75. +35
    -1
      code/html/custom.js
  76. +59
    -26
      code/html/index.html
  77. +2
    -2
      code/platformio.ini
  78. BIN
      images/devices/blitzwolf-bw-shp6.jpg
  79. BIN
      images/devices/digoo-nx-sp202.jpg
  80. BIN
      images/devices/foxel-lightfox-dual.jpg
  81. BIN
      images/devices/gblife-rgbw-socket.jpg
  82. BIN
      images/devices/gosund-ws1.jpg
  83. BIN
      images/devices/green-esp-relay.jpg
  84. BIN
      images/devices/hama-wifi-steckdose.jpg
  85. BIN
      images/devices/litesun-la-wf3.jpg
  86. BIN
      images/devices/lombex-lux-nova2.jpg
  87. BIN
      images/devices/lyasi-rgb-led.jpg
  88. BIN
      images/devices/maxcio-w-de004.jpg
  89. BIN
      images/devices/orvibo-b25.jpg
  90. BIN
      images/devices/oukitel-p1.jpg
  91. BIN
      images/devices/smartlife-mini-smart-socket.jpg
  92. BIN
      images/devices/teckin-sp20.jpg
  93. BIN
      images/devices/tonbux-xs-ssa06.jpg
  94. BIN
      images/devices/wemos-d1-mini-relayshield.jpg
  95. BIN
      images/devices/wemos-d1-relayshield.jpg

+ 101
- 37
README.md View File

@ -82,20 +82,27 @@ Since November 2018, Max Prokhorov (@mcspr) is also actively working as a collab
* Support for [different **sensors**](Sensors)
* Environment
* **DHT11 / DHT12 / DHT22 / DHT21 / AM2301 / Itead's SI7021**
* **BMP280** and **BME280** temperature, humidity (BME280) and pressure sensor by Bosch
* **BMP180**, **BMP280** and **BME280** pressure, humidity (BME280) and temperature (BMP280 & BME280) sensor by Bosch
* **TMP35** and **TMP36** analog temperature sensors
* **MAX6675** temperature sensor
* **NTC** temperature sensors
* **SI7021** temperature and humidity sensor
* **SHT3X** temperature and humidity sensor over I2C (Wemos shield)
* **AM2320** temperature and humidity sensor over I2C
* **Dallas OneWire sensors** like the DS18B20
* **MHZ19** CO2 sensor
* **MICS2710** CO2 & NO2 sensor
* **MICS5525** CO & CO2 sensor
* **SenseAir S8** CO2 sensor
* **PMSX003/PMS5003T/ST** dust sensors
* **SDS011** dust sensor
* **BH1750** luminosity sensor
* **GUVAS12SD** UV sensor
* **GEIGER COUNTER** by RH Electronics
* **VEML6075** UV Sensor
* **EZO pH Circuit**
* **Geiger counter** by RH Electronics
* **HC-SR04**, **SRF05**, **SRF06**, **DYP-ME007**, **JSN-SR04T** & **Parallax PING)))™** distance sensors
* **VL53L1X** distance sensor
* Power monitoring
* **HLW8012** using the [HLW8012 Library](https://bitbucket.org/xoseperez/hlw8012) (Sonoff POW)
* **CSE7766** and **CSE7759B** power monitor chips
@ -220,77 +227,134 @@ For more information please refer to the [ESPurna Wiki](https://github.com/xosep
Here is the list of supported hardware. For more information please refer to the [ESPurna Wiki Hardware page](https://github.com/xoseperez/espurna/wiki/Hardware).
### Power monitoring devices
||||
|---|---|---|
|![BlitzWolf BW-SHP6](images/devices/blitzwolf-bw-shp6.jpg)|![BlitzWolf BW-SHP2](images/devices/blitzwolf-bw-shp2.jpg)|![Power meters based on V9261F](images/devices/generic-v9261f.jpg)|
|**Blitzwolf BW-SHP6**|**Blitzwolf BW-SHP2<br />(also by Coosa, Goosund, HomeCube, Teckin)**|**Power meters based on V9261F**|
|![Itead Sonoff POW](images/devices/itead-sonoff-pow.jpg)|![Itead Sonoff POW](images/devices/itead-sonoff-pow-r2.jpg)|![Itead Sonoff S31](images/devices/itead-sonoff-s31.jpg)|
|**Itead Sonoff POW**|**Itead Sonoff POW R2**|**Itead Sonoff S31**|
|![Smartlife Mini Smart Socket](images/devices/smartlife-mini-smart-socket.jpg)|![Teckin SP20](images/devices/teckin-sp20.jpg)|![Digoo NX SP202](images/devices/digoo-nx-sp202.jpg)|
|**Smartlife (NETVIP) Mini Smart Socket**|**Teckin SP20**|**Digoo NX SP202**|
|![Vanzavanzu Smart WiFi Plug Mini](images/devices/vanzavanzu-smart-wifi-plug-mini.jpg)|||
|**Vanzavanzu Smart WiFi Plug Mini**|||
### Embedded switches
||||
|---|---|---|
|![Tinkerman Espurna H](images/devices/tinkerman-espurna-h.jpg)|![Tinkerman RFM69GW](images/devices/tinkerman-rfm69gw.jpg)||
|**Tinkerman ESPurna H**|**Tinkerman RFM69GW**||
|![Itead Sonoff RF Bridge](images/devices/itead-sonoff-rfbridge.jpg)|![Itead Sonoff RF](images/devices/itead-sonoff-rf.jpg)|![Itead Sonoff 4CH](images/devices/itead-sonoff-4ch.jpg)|
|**Itead Sonoff RF Bridge**|**Itead Sonoff RF**|**Itead Sonoff 4CH**|
|![Itead Sonoff 4CH Pro](images/devices/itead-sonoff-4ch-pro.jpg)|||
|**Itead Sonoff 4CH Pro**|||
|![Itead Sonoff S31](images/devices/itead-sonoff-s31.jpg)|![BlitzWolf BW-SPP2](images/devices/blitzwolf-bw-shp2.jpg)|![Power meters based on V9261F](images/devices/generic-v9261f.jpg)|
|**Itead Sonoff S31**|**Blitzwolf BW-SHP2<br />(also by Coosa, Goosund, HomeCube, Teckin)**|**Power meters based on V9261F**|
|![Itead Sonoff POW](images/devices/itead-sonoff-pow.jpg)|![Itead Sonoff POW](images/devices/itead-sonoff-pow-r2.jpg)|![Vanzavanzu Smart WiFi Plug Mini](images/devices/vanzavanzu-smart-wifi-plug-mini.jpg)|
|**Itead Sonoff POW**|**Itead Sonoff POW R2**|**Vanzavanzu Smart WiFi Plug Mini**|
|![Itead Sonoff Basic](images/devices/itead-sonoff-basic.jpg)|![Itead Sonoff Dual/Dual R2](images/devices/itead-sonoff-dual.jpg)|![Itead Sonoff TH10/TH16](images/devices/itead-sonoff-th.jpg)|
|**Itead Sonoff Basic**|**Itead Sonoff Dual/Dual R2**|**Itead Sonoff TH10/TH16**|
|![Electrodragon WiFi IOT](images/devices/electrodragon-wifi-iot.jpg)|![OpenEnergyMonitor WiFi MQTT Relay / Thermostat](images/devices/openenergymonitor-mqtt-relay.jpg)||
|**Electrodragon WiFi IOT**|**OpenEnergyMonitor WiFi MQTT Relay / Thermostat**||
|![Itead S20](images/devices/itead-s20.jpg)|![Itead S20](images/devices/itead-s26.jpg)|![Neo Coolcam NAS WR01W](images/devices/neo-coolcam-wifi.jpg)|
|![Itead Sonoff 4CH](images/devices/itead-sonoff-4ch.jpg)|![Itead Sonoff 4CH Pro](images/devices/itead-sonoff-4ch-pro.jpg)||
|**Itead Sonoff 4CH**|**Itead Sonoff 4CH Pro**||
|![Allterco Shelly1](images/devices/allterco-shelly1.jpg)|![Allterco Shelly2](images/devices/allterco-shelly2.jpg)|![Jan Goedeke Wifi Relay (NO/NC)](images/devices/jangoe-wifi-relay.jpg)|
|**Alterco Shelly1**|**Alterco Shelly2**|**Jan Goedeke Wifi Relay (NO/NC)**|
|![EXS Wifi Relay v3.1](images/devices/exs-wifi-relay-v31.jpg)|![EXS Wifi Relay v5.0](images/devices/exs-wifi-relay-v50.jpg)|![Jorge García Wifi + Relays Board Kit](images/devices/jorgegarcia-wifi-relays.jpg)|
|**EXS Wifi Relay v3.1**|**EXS Wifi Relay v5.0**|**Jorge García Wifi + Relays Board Kit**|
|![Allnet ESP8266-UP-Relay](images/devices/allnet-esp8266-up-relay.jpg)|![Bruno Horta's OnOfre](images/devices/bh-onofre.jpg)|![Luani HVIO](images/devices/luani-hvio.jpg)|
|**Allnet ESP8266-UP-Relay**|**Bruno Horta's OnOfre**|**Luani HVIO**|
### Wall Sockets
||||
|---|---|---|
|![Itead S20](images/devices/itead-s20.jpg)|![Itead S26](images/devices/itead-s26.jpg)|![Neo Coolcam NAS WR01W](images/devices/neo-coolcam-wifi.jpg)|
|**Itead S20**|**Itead S26**|**Neo Coolcam NAS WR01W**|
|![Schuko Wifi Plug](images/devices/schuko-wifi-plug.jpg)|![Schuko Wifi Plug V2](images/devices/schuko-wifi-plug-v2.jpg)|
|**Schuko Wifi Plug**|**Schuko Wifi Plug V2**|
|![KMC 70011](images/devices/kmc-70011.jpg)|![Xenon SM-PW702U](images/devices/xenon-sm-pw702u.jpg)||
**KMC 70011**|**Xenon SM-PW702U**||
|![Maxcio W-US002S](images/devices/maxcio-w-us002s.jpg)|![HEYGO HY02](images/devices/heygo-hy02.jpg)|![YiDian XS-SSA05](images/devices/yidian-xs-ssa05.jpg)|
|**Maxcio W-US002S**|**HEYGO HY02**|**YiDian XS-SSA05**|
|![WiOn 50055](images/devices/wion-50055.jpg)|![LINGAN SWA1](images/devices/lingan-swa1.jpg)|![HomeCube 16A](images/devices/homecube-16a.jpg)|
|**WiOn 50055**|**LINGAN SWA1**|**HomeCube 16A**|
|![WorkChoice EcoPlug](images/devices/workchoice-ecoplug.jpg)|![Bestek MRJ1011](images/devices/bestek-mrj1011.jpg)|![Tonbux XS-SSA01](images/devices/tonbux-xs-ssa01.jpg)|
|**WorkChoice EcoPlug**|**Bestek MRJ1011**|**Tonbux XS-SSA01**|
|![Tonbux PowerStrip02](images/devices/tonbux-powerstrip02.jpg)|![ForNorm Power Strip](images/devices/fornorm-power-strip.jpg)|![Zhilde ZLD-EU55-W](images/devices/zhilde-zld-eu55-w.jpg)|
|**Tonbux PowerStrip02**|**Fornorm Power Strip**|**Zhilde ZLD-EU55-W**|
|![Schuko Wifi Plug](images/devices/schuko-wifi-plug.jpg)|![Schuko Wifi Plug V2](images/devices/schuko-wifi-plug-v2.jpg)|![KMC 70011](images/devices/kmc-70011.jpg)|
|**Schuko Wifi Plug**|**Schuko Wifi Plug V2**|**KMC 70011**|
|![Xenon SM-PW702U](images/devices/xenon-sm-pw702u.jpg)|![Orvibo B25](images/devices/orvibo-b25.jpg)|![Oukitel P1](images/devices/oukitel-p1.jpg)|
|**Xenon SM-PW702U**|**Orvibo B25**|**Oukitel P1**|
|![Tonbux XS-SSA06](images/devices/tonbux-xs-ssa06.jpg)|![Litesun LA-WF3](images/devices/litesun-la-wf3.jpg)|![Maxcio W DE-004](images/devices/maxcio-w-de004.jpg)|
|**Tonbux XS-SSA06**|**Litesun LA-WF3**|**Maxcio W DE-004**|
|![Hama WiFi Steckdose](images/devices/hama-wifi-steckdose.jpg)|![GBLife RGBW Socket](images/devices/gblife-rgbw-socket.jpg)||
|**Hama WiFi Steckdose**|**GBLife RGBW Socket**||
### Wall switches
||||
|---|---|---|
|![Itead Sonoff Touch](images/devices/itead-sonoff-touch.jpg)|![Itead Sonoff T1](images/devices/itead-sonoff-t1.jpg)|![YJZK switch](images/devices/yjzk-2gang-switch.jpg)|
|**Itead Sonoff Touch**|**Itead Sonoff T1**|**YJZK 1/2/3-gangs switch**|
|![Gosund WS1 / KS-602S](images/devices/gosund-ws1.jpg)|||
|**Gosund WS1 / KS-602S**|||
### Power strips
||||
|---|---|---|
|![Tonbux PowerStrip02](images/devices/tonbux-powerstrip02.jpg)|![ForNorm ZLD-34EU](images/devices/fornorm-power-strip.jpg)|![Zhilde ZLD-EU55-W](images/devices/zhilde-zld-eu55-w.jpg)|
|**Tonbux PowerStrip02**|**Fornorm Power Strip**|**Zhilde ZLD-EU55-W**|
### Smart lights
||||
|---|---|---|
|![Itead Slampher](images/devices/itead-slampher.jpg)|![Arilux E27](images/devices/arilux-e27.jpg)|![Itead Sonoff B1](images/devices/itead-sonoff-b1.jpg)|
|**Itead Slampher**|**Arilux E27**|**Itead Sonoff B1**|
|![AI-Thinker Wifi Light / Noduino OpenLight](images/devices/aithinker-ai-light.jpg)|![Authometion LYT8266](images/devices/authometion-lyt8266.jpg)|![AG-L4](images/devices/ag-l4.jpg)|
|**AI-Thinker Wifi Light / Noduino OpenLight**|**Authometion LYT8266**|**AG-L4**|
|![Lohas 9W](images/devices/lohas-9w.jpg)|![Xiaomi Smart Desk Lamp](images/devices/xiaomi-smart-desk-lamp.jpg)|![iWoole LED Table Lamp](images/devices/iwoole-led-table-lamp.jpg)|
|**Lohas 9W**|**Xiaomi Smart Desk Lamp**|**iWoole LED Table Lamp**|
|![Itead Sonoff LED](images/devices/itead-sonoff-led.jpg)|![Itead BN-SZ01](images/devices/itead-bn-sz01.jpg)|![InterMitTech QuinLED 2.6](images/devices/intermittech-quinled-2.6.jpg)|
|**Itead Sonoff LED**|**Itead BN-SZ01**|**InterMitTech QuinLED 2.6**|
|![Itead Sonoff LED](images/devices/itead-sonoff-led.jpg)|![Itead BN-SZ01](images/devices/itead-bn-sz01.jpg)|![Lombox LUX Nova 2](images/devices/lombex-lux-nova2.jpg)|
|**Itead Sonoff LED**|**Itead BN-SZ01**|**Lombex LUX Nova 2 (white and color)**|
|![Arilux AL-LC01 (RGB)](images/devices/arilux-al-lc01.jpg)|![Arilux AL-LC02 (RGBW)](images/devices/arilux-al-lc02.jpg)|![Arilux AL-LC06 (RGBWWCW)](images/devices/arilux-al-lc06.jpg)|
|**Arilux AL-LC01 (RGB)**|**Arilux AL-LC02 (RGBW)**|**Arilux AL-LC06 (RGBWWCW)**|
|![Arilux AL-LC11 (RGBWWW) & RF](images/devices/arilux-al-lc11.jpg)|![MagicHome LED Controller (1.0 and 2.x)](images/devices/magichome-led-controller.jpg)|![Huacanxing H801/802](images/devices/huacanxing-h801.jpg)|
|**Arilux AL-LC11 (RGBWWW) & RF**|**MagicHome LED Controller (1.0/2.x)**|**Huacanxing H801/802**|
|**Arilux AL-LC11 (RGBWWW) & RF**|**MagicHome LED Controller (1.0/2.x, also ZJ WFMN A/B11)**|**Huacanxing H801/802**|
### Radio links / gateways
||||
|---|---|---|
|![Tinkerman RFM69GW](images/devices/tinkerman-rfm69gw.jpg)|![Itead Sonoff RF Bridge](images/devices/itead-sonoff-rfbridge.jpg)|![Itead Sonoff RF](images/devices/itead-sonoff-rf.jpg)|
|**Tinkerman RFM69GW**|**Itead Sonoff RF Bridge**|**Itead Sonoff RF**|
### Other devices
||||
|---|---|---|
|![Tonbux Mosquito Killer](images/devices/tonbux-mosquito-killer.jpg)|![Itead Sonoff IFAN02](images/devices/itead-sonoff-ifan02.jpg)||
|**Tonbux Mosquito Killer**|**Itead Sonoff IFAN02**|||
### Custom & Development boards
||||
|---|---|---|
|![Tinkerman Espurna H](images/devices/tinkerman-espurna-h.jpg)||![NodeMCU](images/devices/nodemcu-lolin-v3.jpg)|
|**Tinkerman ESPurna H**||**NodeMCU Lolin V3**|
|![Itead Sonoff SV](images/devices/itead-sonoff-sv.jpg)|![Itead 1CH Inching](images/devices/itead-1ch-inching.jpg)|![Itead Motor Clockwise/Anticlockwise](images/devices/itead-motor.jpg)|
|**Itead Sonoff SV**|**Itead 1CH Inching**|**Itead Motor Clockwise/Anticlockwise**|
|![Jan Goedeke Wifi Relay (NO/NC)](images/devices/jangoe-wifi-relay.jpg)|![Jorge García Wifi + Relays Board Kit](images/devices/jorgegarcia-wifi-relays.jpg)|![EXS Wifi Relay v3.1](images/devices/exs-wifi-relay-v31.jpg)|
|**Jan Goedeke Wifi Relay (NO/NC)**|**Jorge García Wifi + Relays Board Kit**|**EXS Wifi Relay v3.1**|
|![EXS Wifi Relay v5.0](images/devices/exs-wifi-relay-v50.jpg)|![Allterco Shelly1](images/devices/allterco-shelly1.jpg)|![Allterco Shelly2](images/devices/allterco-shelly2.jpg)|
|**EXS Wifi Relay v5.0**|**Alterco Shelly1**|**Alterco Shelly2**|
|![ManCaveMade ESP-Live](images/devices/mancavemade-esp-live.jpg)|![Wemos D1 Mini Relay Shield](images/devices/wemos-d1-mini-relayshield.jpg)|![Witty Cloud](images/devices/witty-cloud.jpg)|
|**ManCaveMade ESP-Live**|**Wemos D1 Mini Relay Shield**|**Witty Cloud**|
|![ManCaveMade ESP-Live](images/devices/mancavemade-esp-live.jpg)|![Wemos D1 Mini Relay Shield](images/devices/wemos-d1-relayshield.jpg)|![Gizwits Witty Cloud](images/devices/witty-cloud.jpg)|
|**ManCaveMade ESP-Live**|**Wemos D1 Mini Relay Shield**|**Gizwits Witty Cloud**|
|![IKE ESPike](images/devices/ike-espike.jpg)|![Pilotak ESP DIN](images/devices/pilotak-esp-din.jpg)|![Arniex Swifitch](images/devices/arniex-swifitch.jpg)|
|**IKE ESPike**|**Pilotak ESP DIN|**Arniex Swifitch**|
|![Heltec Touch Relay](images/devices/heltec-touch-relay.jpg)|![Generic Relay v4.0](images/devices/generic-relay-40.jpg)|![Generic RGBLed v1.0](images/devices/generic-rgbled-10.jpg)|
|**Heltec Touch Relay**|**Generic Relay v4.0**|**Generic RGBLed v1.0**|
|![Generic DHT11 v1.0](images/devices/generic-dht11-10.jpg)|![Generic DS18B20 v1.0](images/devices/generic-ds18b20-10.jpg)|![Bruno Horta's OnOfre](images/devices/bh-onofre.jpg)|
|**Generic DHT11 v1.0**|**Generic DS18B20 v1.0**|**Bruno Horta's OnOfre**|
|![Allnet ESP8266-UP-Relay](images/devices/allnet-esp8266-up-relay.jpg)|![RH Electronics Geiger Counter](images/devices/generic-geiger-diy.png)|![Luani HVIO](images/devices/luani-hvio.jpg)|
|**Allnet ESP8266-UP-Relay**|**RH Electronics Geiger Counter**|**Luani HVIO**|
|![Phyx ESP12 RGBW](images/devices/phyx-esp12-rgbw.jpg)|||
|**Phyx ESP12 RGBW**||||
|![Tonbux Mosquito Killer](images/devices/tonbux-mosquito-killer.jpg)|![Itead Sonoff IFAN02](images/devices/itead-sonoff-ifan02.jpg)||
|**Tonbux Mosquito Killer**|**Itead Sonoff IFAN02**|||
|![Generic DHT11 v1.0](images/devices/generic-dht11-10.jpg)|![Generic DS18B20 v1.0](images/devices/generic-ds18b20-10.jpg)|![InterMitTech QuinLED 2.6](images/devices/intermittech-quinled-2.6.jpg)|
|**Generic DHT11 v1.0**|**Generic DS18B20 v1.0**|**InterMitTech QuinLED 2.6**|
|![Phyx ESP12 RGBW](images/devices/phyx-esp12-rgbw.jpg)|![RH Electronics Geiger Counter](images/devices/generic-geiger-diy.png)|![Green ESP Relay](images/devices/green-esp-relay.jpg)|
|**Phyx ESP12 RGBW**|**RH Electronics Geiger Counter**|**Green ESP Relay**|
|![Foxel Lightfox Dual](images/devices/foxel-lightfox-dual.jpg)|||
|**Foxel Lightfox Dual**|||
**Other supported boards (beta):**
KMC 4 Outlet, Gosund WS1, MakerFocus Intelligent Module LM33 for Lamps
## License
Copyright (C) 2016-2018 by Xose Pérez (@xoseperez)
Copyright (C) 2016-2019 by Xose Pérez (@xoseperez)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


+ 1
- 1
code/espurna/broker.ino View File

@ -2,7 +2,7 @@
BROKER MODULE
Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


+ 107
- 94
code/espurna/config/arduino.h View File

@ -7,117 +7,128 @@
// Hardware
//--------------------------------------------------------------------------------
//#define NODEMCU_LOLIN
//#define WEMOS_D1_MINI
//#define WEMOS_D1_MINI_RELAYSHIELD
//#define TINKERMAN_ESPURNA_H06
//#define TINKERMAN_ESPURNA_H08
//#define TINKERMAN_RFM69GW
//#define ITEAD_SONOFF_BASIC
//#define ITEAD_SONOFF_RF
//#define ITEAD_SONOFF_TH
//#define ITEAD_SONOFF_SV
//#define ITEAD_SLAMPHER
//#define AITHINKER_AI_LIGHT
//#define ALLNET_4DUINO_IOT_WLAN_RELAIS
//#define ALLTERCO_SHELLY1
//#define ALLTERCO_SHELLY2
//#define ARILUX_AL_LC01
//#define ARILUX_AL_LC02
//#define ARILUX_AL_LC02_V14
//#define ARILUX_AL_LC06
//#define ARILUX_AL_LC11
//#define ARILUX_E27
//#define ARNIEX_SWIFITCH
//#define AUTHOMETION_LYT8266
//#define BESTEK_MRJ1011
//#define BH_ONOFRE
//#define BLITZWOLF_BWSHPX
//#define BLITZWOLF_BWSHPX_V23
//#define DIGOO_NX_SP202
//#define ELECTRODRAGON_WIFI_IOT
//#define ESPURNA_CORE
//#define EUROMATE_WIFI_STECKER_SCHUKO
//#define EUROMATE_WIFI_STECKER_SCHUKO_V2
//#define EXS_WIFI_RELAY_V31
//#define EXS_WIFI_RELAY_V50
//#define FORNORM_ZLD_34EU
//#define FOXEL_LIGHTFOX_DUAL
//#define GBLIFE_RGBW_SOCKET
//#define GENERIC_8CH
//#define GENERIC_AG_L4
//#define GENERIC_ECH1560
//#define GENERIC_ESP01S_DHT11_V10
//#define GENERIC_ESP01S_DS18B20_V10
//#define GENERIC_ESP01S_RELAY_V40
//#define GENERIC_ESP01S_RGBLED_V10
//#define GENERIC_V9261F
//#define GIZWITS_WITTY_CLOUD
//#define GOSUND_WS1
//#define GREEN_ESP8266RELAY
//#define HAMA_WIFI_STECKDOSE_00176533
//#define HELTEC_TOUCHRELAY
//#define HEYGO_HY02
//#define HOMECUBE_16A
//#define HUACANXING_H801
//#define HUACANXING_H802
//#define IKE_ESPIKE
//#define INTERMITTECH_QUINLED
//#define ITEAD_1CH_INCHING
//#define ITEAD_BNSZ01
//#define ITEAD_MOTOR
//#define ITEAD_S20
//#define ITEAD_SONOFF_TOUCH
//#define ITEAD_SONOFF_POW
//#define ITEAD_SONOFF_POW_R2
//#define ITEAD_SONOFF_DUAL
//#define ITEAD_SONOFF_DUAL_R2
//#define ITEAD_SLAMPHER
//#define ITEAD_SONOFF_4CH
//#define ITEAD_SONOFF_4CH_PRO
//#define ITEAD_1CH_INCHING
//#define ITEAD_MOTOR
//#define ITEAD_SONOFF_BNSZ01
//#define ITEAD_SONOFF_RFBRIDGE
//#define ITEAD_SONOFF_B1
//#define ITEAD_SONOFF_BASIC
//#define ITEAD_SONOFF_BNSZ01
//#define ITEAD_SONOFF_DUAL
//#define ITEAD_SONOFF_DUAL_R2
//#define ITEAD_SONOFF_IFAN02
//#define ITEAD_SONOFF_LED
//#define ITEAD_SONOFF_POW
//#define ITEAD_SONOFF_POW_R2
//#define ITEAD_SONOFF_RF
//#define ITEAD_SONOFF_RFBRIDGE
//#define ITEAD_SONOFF_S31
//#define ITEAD_SONOFF_SV
//#define ITEAD_SONOFF_T1_1CH
//#define ITEAD_SONOFF_T1_2CH
//#define ITEAD_SONOFF_T1_3CH
//#define ITEAD_SONOFF_S31
//#define ORVIBO_B25
//#define YJZK_SWITCH_2CH
//#define ELECTRODRAGON_WIFI_IOT
//#define WORKCHOICE_ECOPLUG
//#define AITHINKER_AI_LIGHT
//#define LYASI_LIGHT
//#define MAGICHOME_LED_CONTROLLER
//#define MAGICHOME_LED_CONTROLLER_20
//#define HUACANXING_H801
//#define HUACANXING_H802
//#define ITEAD_SONOFF_TH
//#define ITEAD_SONOFF_TOUCH
//#define IWOOLE_LED_TABLE_LAMP
//#define JANGOE_WIFI_RELAY_NC
//#define JANGOE_WIFI_RELAY_NO
//#define JORGEGARCIA_WIFI_RELAYS
//#define OPENENERGYMONITOR_MQTT_RELAY
//#define WION_50055
//#define EXS_WIFI_RELAY_V31
//#define GENERIC_V9261F
//#define GENERIC_ECH1560
//#define MANCAVEMADE_ESPLIVE
//#define INTERMITTECH_QUINLED
//#define ARILUX_AL_LC06
//#define ARILUX_E27
//#define XENON_SM_PW702U
//#define AUTHOMETION_LYT8266
//#define KMC_70011
//#define GENERIC_8CH
//#define ARILUX_AL_LC01
//#define ARILUX_AL_LC11
//#define ARILUX_AL_LC02
//#define WEMOS_D1_TARPUNA_SHIELD
//#define GIZWITS_WITTY_CLOUD
//#define EUROMATE_WIFI_STECKER_SCHUKO
//#define EUROMATE_WIFI_STECKER_SCHUKO_V2
//#define TONBUX_POWERSTRIP02
//#define LINGAN_SWA1
//#define HEYGO_HY02
//#define MAXCIO_WUS002S
//#define OUKITEL_P1
//#define YIDIAN_XSSSA05
//#define TONBUX_XSSSA06
//#define TONBUX_XSSSA01
//#define GREEN_ESP8266RELAY
//#define IKE_ESPIKE
//#define ARNIEX_SWIFITCH
//#define GENERIC_ESP01S_RELAY_V40
//#define GENERIC_ESP01S_RGBLED_V10
//#define GENERIC_ESP01S_DHT11_V10
//#define GENERIC_ESP01S_DS18B20_V10
//#define HELTEC_TOUCHRELAY
//#define ZHILDE_EU44_W
//#define LUANI_HVIO
//#define ALLNET_4DUINO_IOT_WLAN_RELAIS
//#define TONBUX_MOSQUITO_KILLER
//#define NEO_COOLCAM_NAS_WR01W
//#define ESTINK_WIFI_POWER_STRIP
//#define PILOTAK_ESP_DIN_V1
//#define BLITZWOLF_BWSHPX
//#define BH_ONOFRE
//#define ITEAD_SONOFF_IFAN02
//#define GENERIC_AG_L4
//#define ALLTERCO_SHELLY1
//#define LITESUN_LA_WF3
//#define LOHAS_9W
//#define YJZK_SWITCH_1CH
//#define YJZK_SWITCH_3CH
//#define XIAOMI_SMART_DESK_LAMP
//#define ALLTERCO_SHELLY2
//#define PHYX_ESP12_RGB
//#define IWOOLE_LED_TABLE_LAMP
//#define EXS_WIFI_RELAY_V50
//#define TECKIN_SP22_V14
//#define LOMBEX_LUX_NOVA2_TUNABLE_WHITE
//#define LOMBEX_LUX_NOVA2_WHITE_COLOR
//#define LUANI_HVIO
//#define LYASI_LIGHT
//#define MAGICHOME_LED_CONTROLLER
//#define MAGICHOME_LED_CONTROLLER_20
//#define MAGICHOME_ZJ_WFMN_A_11
//#define MAGICHOME_ZJ_WFMN_B_11
//#define GBLIFE_RGBW_SOCKET
//#define MANCAVEMADE_ESPLIVE
//#define MAXCIO_WDE004
//#define MAXCIO_WUS002S
//#define NEO_COOLCAM_NAS_WR01W
//#define NODEMCU_BASIC
//#define NODEMCU_LOLIN
//#define OPENENERGYMONITOR_MQTT_RELAY
//#define ORVIBO_B25
//#define OUKITEL_P1
//#define PHYX_ESP12_RGB
//#define PILOTAK_ESP_DIN_V1
//#define SMARTLIFE_MINI_SMART_SOCKET
//#define GOSUND_SP1_V23
//#define GOSUND_WS1
//#define ARILUX_AL_LC02_V14
//#define BLITZWOLF_BWSHPX_V23
//#define DIGOO_NX_SP202
//#define FOXEL_LIGHTFOX_DUAL
//#define STM_RELAY
//#define TECKIN_SP20
//#define TECKIN_SP22_V14
//#define TINKERMAN_ESPURNA_H06
//#define TINKERMAN_ESPURNA_H08
//#define TINKERMAN_ESPURNA_SWITCH
//#define TINKERMAN_RFM69GW
//#define TONBUX_MOSQUITO_KILLER
//#define TONBUX_POWERSTRIP02
//#define TONBUX_XSSSA01
//#define TONBUX_XSSSA06
//#define VANZAVANZU_SMART_WIFI_PLUG_MINI
//#define WEMOS_D1_MINI
//#define WEMOS_D1_MINI_RELAYSHIELD
//#define WEMOS_D1_TARPUNA_SHIELD
//#define WION_50055
//#define WORKCHOICE_ECOPLUG
//#define XENON_SM_PW702U
//#define XIAOMI_SMART_DESK_LAMP
//#define YIDIAN_XSSSA05
//#define YJZK_SWITCH_1CH
//#define YJZK_SWITCH_2CH
//#define YJZK_SWITCH_3CH
//#define ZHILDE_EU44_W
//--------------------------------------------------------------------------------
// Features (values below are non-default values)
@ -145,8 +156,8 @@
//#define NETBIOS_SUPPORT 1 // Only with Arduino Core 2.4.0
//#define NOFUSS_SUPPORT 1
//#define NTP_SUPPORT 0
//#define RFM69_SUPPORT 1
//#define RF_SUPPORT 1
//#define RFM69_SUPPORT 1
//#define SCHEDULER_SUPPORT 0
//#define SENSOR_SUPPORT 1
//#define SPIFFS_SUPPORT 1
@ -175,9 +186,11 @@
//#define EMON_ADS1X15_SUPPORT 1
//#define EMON_ANALOG_SUPPORT 1
//#define EVENTS_SUPPORT 1
//#define EZOPH_SUPPORT 1
//#define GEIGER_SUPPORT 1
//#define GUVAS12SD_SUPPORT 1
//#define HLW8012_SUPPORT 1
//#define MAX6675_SUPPORT 1
//#define MHZ19_SUPPORT 1
//#define MICS2710_SUPPORT 1
//#define MICS5525_SUPPORT 1
@ -192,5 +205,5 @@
//#define SONAR_SUPPORT 1
//#define TMP3X_SUPPORT 1
//#define V9261F_SUPPORT 1
//#define VEML6075_SUPPORT 1
//#define VL53L1X_SUPPORT 1
//#define EZOPH_SUPPORT 1

+ 1
- 1
code/espurna/config/general.h View File

@ -491,7 +491,7 @@
// there are no special requirements. Any static web server will do (NGinx, Apache, Lighttpd,...).
// The only requirement is that the resource must be available under this domain.
#ifndef WEB_REMOTE_DOMAIN
#define WEB_REMOTE_DOMAIN "http://tinkerman.cat"
#define WEB_REMOTE_DOMAIN "http://espurna.io"
#endif
// -----------------------------------------------------------------------------


+ 18
- 57
code/espurna/config/hardware.h View File

@ -34,20 +34,22 @@
#define MANUFACTURER "ESPRESSIF"
#define DEVICE "ESPURNA_CORE"
// UI modules
#define BUTTON_SUPPORT 0
#define MDNS_SERVER_SUPPORT 0
#define NTP_SUPPORT 0
#define WEB_SUPPORT 0
// Disable non-core modules
#define ALEXA_SUPPORT 0
#define BROKER_SUPPORT 0
#define BUTTON_SUPPORT 0
#define DOMOTICZ_SUPPORT 0
#define HOMEASSISTANT_SUPPORT 0
#define I2C_SUPPORT 0
#define MDNS_SERVER_SUPPORT 0
#define MQTT_SUPPORT 0
#define NTP_SUPPORT 0
#define SCHEDULER_SUPPORT 0
#define SENSOR_SUPPORT 0
#define THINGSPEAK_SUPPORT 0
#define WEB_SUPPORT 0
// Extra light-weight image
//#define DEBUG_SERIAL_SUPPORT 0
@ -123,7 +125,7 @@
#define RELAY1_PIN 5
#define RELAY1_TYPE RELAY_TYPE_NORMAL
// Light RGBW
// LED
#define LED1_PIN 2
#define LED1_PIN_INVERSE 1
@ -226,7 +228,6 @@
#define RELAY1_PIN 12
#define RELAY1_TYPE RELAY_TYPE_INVERSE
// Check http://tinkerman.cat/rfm69-wifi-gateway/
#elif defined(TINKERMAN_RFM69GW)
@ -2102,14 +2103,10 @@
#define LED1_PIN_INVERSE 1
// -----------------------------------------------------------------------------
// Oukitel - P1
// Oukitel P1 Smart Plug
// https://www.amazon.com/Docooler-OUKITEL-Control-Wireless-Adaptor/dp/B07J3BYFJX/ref=sr_1_fkmrnull_2?keywords=oukitel+p1+smart+switch&qid=1550424399&s=gateway&sr=8-2-fkmrnull
// -----------------------------------------------------------------------------
#elif defined(OUKITEL_P1)
// -----------------------------------------------------------------------------
// Oukitel P1 Smart Plug
// https://www.amazon.com/Docooler-OUKITEL-Control-Wireless-Adaptor/dp/B07J3BYFJX/ref=sr_1_fkmrnull_2?keywords=oukitel+p1+smart+switch&qid=1550424399&s=gateway&sr=8-2-fkmrnull
// -----------------------------------------------------------------------------
// Info
#define MANUFACTURER "Oukitel"
@ -2644,17 +2641,16 @@
// ------------------------------------------------------------------------------
// Estink Wifi Power Strip
// https://www.amazon.de/Steckdosenleiste-Ladeger%C3%A4t-Sprachsteuerung-SmartphonesTablets-Android/dp/B0796W5FZY
// Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
// https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
// Also: Estink Wifi Power Strip
// -----------------------------------------------------------------------------
#elif defined(ESTINK_WIFI_POWER_STRIP)
#elif defined(FORNORM_ZLD_34EU)
// Info
#define MANUFACTURER "ESTINK"
#define DEVICE "WIFI_POWER_STRIP"
#define MANUFACTURER "FORNORM"
#define DEVICE "ZLD_34EU"
// Disable UART noise since this board uses GPIO3
#define DEBUG_SERIAL_SUPPORT 0
@ -2855,6 +2851,7 @@
// -----------------------------------------------------------------------------
// Several boards under different names uing a power chip labelled BL0937 or HJL-01
// Also model number KS-602S
// -----------------------------------------------------------------------------
#elif defined(GOSUND_WS1)
@ -2876,44 +2873,6 @@
#define LED1_PIN 1
#define LED1_PIN_INVERSE 1
// This one is the same as the BLITZWOLF_BWSHPX_V23
#elif defined(GOSUND_SP1_V23)
// Info
#define MANUFACTURER "GOSUND"
#define DEVICE "SP1_v23"
// Buttons
#define BUTTON1_PIN 3
#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON1_RELAY 1
// Relays
#define RELAY1_PIN 14
#define RELAY1_TYPE RELAY_TYPE_NORMAL
// LEDs
#define LED1_PIN 1
#define LED1_PIN_INVERSE 1
#define LED2_PIN 13
#define LED2_PIN_INVERSE 0
#define LED2_MODE LED_MODE_FINDME
#define LED2_RELAY 1
// HJL01 / BL0937
#ifndef HLW8012_SUPPORT
#define HLW8012_SUPPORT 1
#endif
#define HLW8012_SEL_PIN 12
#define HLW8012_CF1_PIN 5
#define HLW8012_CF_PIN 4
#define HLW8012_SEL_CURRENT LOW
#define HLW8012_CURRENT_RATIO 25740
#define HLW8012_VOLTAGE_RATIO 313400
#define HLW8012_POWER_RATIO 3414290
#define HLW8012_INTERRUPT_ON FALLING
// ----------------------------------------------------------------------------------------
// Homecube 16A is similar but some pins differ and it also has RGB LEDs
// https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
@ -3320,8 +3279,10 @@
#define LIGHT_CH4_INVERSE 0
// ----------------------------------------------------------------------------------------
// Smart life Mini Smart Socket is similar Homecube 16A but some GPIOs differ
// https://www.ebay.de/itm/Smart-Steckdose-WIFI-WLAN-Amazon-Alexa-Fernbedienung-Home-Socket-Zeitschaltuh-DE/123352026749?hash=item1cb85a8e7d:g:IasAAOSwk6dbj390
// Smart life Mini Smart Socket is similar Homecube 16A but some GPIOs differ
// https://www.ebay.de/itm/Smart-Steckdose-WIFI-WLAN-Amazon-Alexa-Fernbedienung-Home-Socket-Zeitschaltuh-DE/123352026749?hash=item1cb85a8e7d:g:IasAAOSwk6dbj390
// Also labeled NETVIP
// https://www.amazon.es/Inteligente-NETVIP-Inal%C3%A1mbrico-Interruptor-Funciona/dp/B07KH8YWS5
// ----------------------------------------------------------------------------------------
#elif defined(SMARTLIFE_MINI_SMART_SOCKET)


+ 1
- 1
code/espurna/config/sensors.h View File

@ -1026,7 +1026,7 @@
#endif
#if MAX6675_SUPPORT
#include "../sensors/MAX6675.h"
#include "../sensors/MAX6675Sensor.h"
#endif
#if MHZ19_SUPPORT


BIN
code/espurna/data/index.all.html.gz View File


BIN
code/espurna/data/index.light.html.gz View File


BIN
code/espurna/data/index.lightfox.html.gz View File


BIN
code/espurna/data/index.rfbridge.html.gz View File


BIN
code/espurna/data/index.rfm69.html.gz View File


BIN
code/espurna/data/index.sensor.html.gz View File


BIN
code/espurna/data/index.small.html.gz View File


+ 1
- 1
code/espurna/encoder.ino View File

@ -2,7 +2,7 @@
ENCODER MODULE
Copyright (C) 2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2018-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


+ 1
- 1
code/espurna/filters/BaseFilter.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// Base Filter (other filters inherit from this)
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT


+ 1
- 1
code/espurna/filters/LastFilter.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// Last Filter
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT


+ 1
- 1
code/espurna/filters/MaxFilter.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// Max Filter
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT


+ 1
- 1
code/espurna/filters/MedianFilter.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// Median Filter
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT


+ 1
- 1
code/espurna/filters/MovingAverageFilter.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// Moving Average Filter
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT


+ 1
- 1
code/espurna/gpio.ino View File

@ -2,7 +2,7 @@
GPIO MODULE
Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


+ 1
- 1
code/espurna/homeassistant.ino View File

@ -2,7 +2,7 @@
HOME ASSISTANT MODULE
Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


+ 1
- 1
code/espurna/i2c.ino View File

@ -2,7 +2,7 @@
I2C MODULE
Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


+ 1
- 1
code/espurna/influxdb.ino View File

@ -2,7 +2,7 @@
INFLUXDB MODULE
Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


+ 1
- 1
code/espurna/ir.ino View File

@ -3,7 +3,7 @@
IR MODULE
Copyright (C) 2018 by Alexander Kolesnikov (raw and MQTT implementation)
Copyright (C) 2017-2018 by François Déchery
Copyright (C) 2017-2019 by François Déchery
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
-----------------------------------------------------------------------------


+ 33
- 15
code/espurna/led.ino View File

@ -51,6 +51,16 @@ void _ledMode(unsigned char id, unsigned char mode) {
_leds[id].mode = mode;
}
unsigned char _ledRelay(unsigned char id) {
if (id >= _ledCount()) return false;
return _leds[id].relay;
}
void _ledRelay(unsigned char id, unsigned char relay) {
if (id >= _ledCount()) return;
_leds[id].relay = relay;
}
void _ledBlink(unsigned char id, unsigned long delayOff, unsigned long delayOn) {
if (id >= _ledCount()) return;
static unsigned long next = millis();
@ -68,7 +78,12 @@ bool _ledWebSocketOnReceive(const char * key, JsonVariant& value) {
void _ledWebSocketOnSend(JsonObject& root) {
if (_ledCount() == 0) return;
root["ledVisible"] = 1;
root["ledMode0"] = _ledMode(0);
JsonArray& leds = root.createNestedArray("ledConfig");
for (byte i=0; i<_ledCount(); i++) {
JsonObject& led = leds.createNestedObject();
led["mode"] = getSetting("ledMode", i, "").toInt();
led["relay"] = getSetting("ledRelay", i, "").toInt();
}
}
#endif
@ -133,6 +148,7 @@ unsigned char _ledCount() {
void _ledConfigure() {
for (unsigned int i=0; i < _leds.size(); i++) {
_ledMode(i, getSetting("ledMode", i, _ledMode(i)).toInt());
_ledRelay(i, getSetting("ledRelay", i, _ledRelay(i)).toInt());
}
_led_update = true;
}
@ -146,32 +162,34 @@ void ledUpdate(bool value) {
void ledSetup() {
#if LED1_PIN != GPIO_NONE
_leds.push_back((led_t) { LED1_PIN, LED1_PIN_INVERSE, LED1_MODE, LED1_RELAY });
_leds.push_back((led_t) { LED1_PIN, LED1_PIN_INVERSE, LED1_MODE, LED1_RELAY - 1 });
#endif
#if LED2_PIN != GPIO_NONE
_leds.push_back((led_t) { LED2_PIN, LED2_PIN_INVERSE, LED2_MODE, LED2_RELAY });
_leds.push_back((led_t) { LED2_PIN, LED2_PIN_INVERSE, LED2_MODE, LED2_RELAY - 1 });
#endif
#if LED3_PIN != GPIO_NONE
_leds.push_back((led_t) { LED3_PIN, LED3_PIN_INVERSE, LED3_MODE, LED3_RELAY });
_leds.push_back((led_t) { LED3_PIN, LED3_PIN_INVERSE, LED3_MODE, LED3_RELAY - 1 });
#endif
#if LED4_PIN != GPIO_NONE
_leds.push_back((led_t) { LED4_PIN, LED4_PIN_INVERSE, LED4_MODE, LED4_RELAY });
_leds.push_back((led_t) { LED4_PIN, LED4_PIN_INVERSE, LED4_MODE, LED4_RELAY - 1 });
#endif
#if LED5_PIN != GPIO_NONE
_leds.push_back((led_t) { LED5_PIN, LED5_PIN_INVERSE, LED5_MODE, LED5_RELAY });
_leds.push_back((led_t) { LED5_PIN, LED5_PIN_INVERSE, LED5_MODE, LED5_RELAY - 1 });
#endif
#if LED6_PIN != GPIO_NONE
_leds.push_back((led_t) { LED6_PIN, LED6_PIN_INVERSE, LED6_MODE, LED6_RELAY });
_leds.push_back((led_t) { LED6_PIN, LED6_PIN_INVERSE, LED6_MODE, LED6_RELAY - 1 });
#endif
#if LED7_PIN != GPIO_NONE
_leds.push_back((led_t) { LED7_PIN, LED7_PIN_INVERSE, LED7_MODE, LED7_RELAY });
_leds.push_back((led_t) { LED7_PIN, LED7_PIN_INVERSE, LED7_MODE, LED7_RELAY - 1 });
#endif
#if LED8_PIN != GPIO_NONE
_leds.push_back((led_t) { LED8_PIN, LED8_PIN_INVERSE, LED8_MODE, LED8_RELAY });
_leds.push_back((led_t) { LED8_PIN, LED8_PIN_INVERSE, LED8_MODE, LED8_RELAY - 1 });
#endif
for (unsigned int i=0; i < _leds.size(); i++) {
pinMode(_leds[i].pin, OUTPUT);
setSetting("ledMode", i, _leds[i].mode);
setSetting("ledRelay", i, _leds[i].relay);
_ledStatus(i, false);
}
@ -225,13 +243,13 @@ void ledLoop() {
if (wifi_state & WIFI_STATE_WPS || wifi_state & WIFI_STATE_SMARTCONFIG) {
_ledBlink(i, 100, 100);
} else if (wifi_state & WIFI_STATE_STA) {
if (relayStatus(_leds[i].relay-1)) {
if (relayStatus(_leds[i].relay)) {
_ledBlink(i, 4900, 100);
} else {
_ledBlink(i, 100, 4900);
}
} else if (wifi_state & WIFI_STATE_AP) {
if (relayStatus(_leds[i].relay-1)) {
if (relayStatus(_leds[i].relay)) {
_ledBlink(i, 900, 100);
} else {
_ledBlink(i, 100, 900);
@ -247,13 +265,13 @@ void ledLoop() {
if (wifi_state & WIFI_STATE_WPS || wifi_state & WIFI_STATE_SMARTCONFIG) {
_ledBlink(i, 100, 100);
} else if (wifi_state & WIFI_STATE_STA) {
if (relayStatus(_leds[i].relay-1)) {
if (relayStatus(_leds[i].relay)) {
_ledBlink(i, 100, 4900);
} else {
_ledBlink(i, 4900, 100);
}
} else if (wifi_state & WIFI_STATE_AP) {
if (relayStatus(_leds[i].relay-1)) {
if (relayStatus(_leds[i].relay)) {
_ledBlink(i, 100, 900);
} else {
_ledBlink(i, 900, 100);
@ -268,11 +286,11 @@ void ledLoop() {
if (!_led_update) continue;
if (_ledMode(i) == LED_MODE_FOLLOW) {
_ledStatus(i, relayStatus(_leds[i].relay-1));
_ledStatus(i, relayStatus(_leds[i].relay));
}
if (_ledMode(i) == LED_MODE_FOLLOW_INVERSE) {
_ledStatus(i, !relayStatus(_leds[i].relay-1));
_ledStatus(i, !relayStatus(_leds[i].relay));
}
if (_ledMode(i) == LED_MODE_FINDME) {


+ 1
- 1
code/espurna/llmnr.ino View File

@ -2,7 +2,7 @@
LLMNR MODULE
Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


+ 1
- 1
code/espurna/mdns.ino View File

@ -2,7 +2,7 @@
MDNS MODULE
Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


+ 1
- 1
code/espurna/migrate.ino View File

@ -986,7 +986,7 @@ void migrate() {
setSetting("relayType", 0, RELAY_TYPE_NORMAL);
setSetting("relayType", 1, RELAY_TYPE_NORMAL);
#elif defined(ESTINK_WIFI_POWER_STRIP)
#elif defined(FORNORM_ZLD_34EU)
setSetting("board", 77);
setSetting("btnGPIO", 0, 16);


+ 1
- 1
code/espurna/netbios.ino View File

@ -2,7 +2,7 @@
NETBIOS MODULE
Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


+ 1
- 1
code/espurna/sensors/AnalogSensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// Analog Sensor (maps to an analogRead)
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && (ANALOG_SUPPORT || NTC_SUPPORT)


+ 1
- 1
code/espurna/sensors/BH1750Sensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// BH1750 Liminosity sensor over I2C
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && BH1750_SUPPORT


+ 1
- 1
code/espurna/sensors/BMP180Sensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// BMP085/BMP180 Sensor over I2C
// Copyright (C) 2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && BMP180_SUPPORT


+ 1
- 1
code/espurna/sensors/BMX280Sensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// BME280/BMP280 Sensor over I2C
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && BMX280_SUPPORT


+ 1
- 1
code/espurna/sensors/BaseSensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// Abstract sensor class (other sensor classes extend this class)
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT


+ 20
- 7
code/espurna/sensors/CSE7766Sensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// CSE7766 based power monitor
// Copyright (C) 2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2019 by Xose Pérez <xose dot perez at gmail dot com>
// http://www.chipsea.com/UploadFiles/2017/08/11144342F01B5662.pdf
// -----------------------------------------------------------------------------
@ -161,9 +161,10 @@ class CSE7766Sensor : public BaseSensor {
if (index == 0) return MAGNITUDE_CURRENT;
if (index == 1) return MAGNITUDE_VOLTAGE;
if (index == 2) return MAGNITUDE_POWER_ACTIVE;
if (index == 3) return MAGNITUDE_POWER_APPARENT;
if (index == 4) return MAGNITUDE_POWER_FACTOR;
if (index == 5) return MAGNITUDE_ENERGY;
if (index == 3) return MAGNITUDE_POWER_REACTIVE;
if (index == 4) return MAGNITUDE_POWER_APPARENT;
if (index == 5) return MAGNITUDE_POWER_FACTOR;
if (index == 6) return MAGNITUDE_ENERGY;
return MAGNITUDE_NONE;
}
@ -172,9 +173,10 @@ class CSE7766Sensor : public BaseSensor {
if (index == 0) return _current;
if (index == 1) return _voltage;
if (index == 2) return _active;
if (index == 3) return _voltage * _current;
if (index == 4) return ((_voltage > 0) && (_current > 0)) ? 100 * _active / _voltage / _current : 100;
if (index == 5) return _energy;
if (index == 3) return _reactive;
if (index == 4) return _voltage * _current;
if (index == 5) return ((_voltage > 0) && (_current > 0)) ? 100 * _active / _voltage / _current : 100;
if (index == 6) return _energy;
return 0;
}
@ -273,6 +275,16 @@ class CSE7766Sensor : public BaseSensor {
}
}
// Calculate reactive power
_reactive = 0;
unsigned int active = _active;
unsigned int apparent = _voltage * _current;
if (apparent > active) {
_reactive = sqrt(apparent * apparent - active * active);
} else {
_reactive = 0;
}
// Calculate energy
unsigned int difference;
static unsigned int cf_pulses_last = 0;
@ -367,6 +379,7 @@ class CSE7766Sensor : public BaseSensor {
SoftwareSerial * _serial = NULL;
double _active = 0;
double _reactive = 0;
double _voltage = 0;
double _current = 0;
double _energy = 0;


+ 1
- 1
code/espurna/sensors/DHTSensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// DHTXX Sensor
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && DHT_SUPPORT


+ 1
- 1
code/espurna/sensors/DallasSensor.h View File

@ -1,7 +1,7 @@
// -----------------------------------------------------------------------------
// Dallas OneWire Sensor
// Uses OneWire library
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && DALLAS_SUPPORT


+ 1
- 1
code/espurna/sensors/DigitalSensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// Digital Sensor (maps to a digitalRead)
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && DIGITAL_SUPPORT


+ 1
- 1
code/espurna/sensors/ECH1560Sensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// ECH1560 based power monitor
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && ECH1560_SUPPORT


+ 1
- 1
code/espurna/sensors/EmonADC121Sensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// ADS121-based Energy Monitor Sensor over I2C
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && EMON_ADC121_SUPPORT


+ 1
- 1
code/espurna/sensors/EmonADS1X15Sensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// ADS1X15-based Energy Monitor Sensor over I2C
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && EMON_ADS1X15_SUPPORT


+ 1
- 1
code/espurna/sensors/EmonAnalogSensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// Energy Monitor Sensor using builtin ADC
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && EMON_ANALOG_SUPPORT


+ 1
- 1
code/espurna/sensors/EmonSensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// Abstract Energy Monitor Sensor (other EMON sensors extend this class)
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT


+ 1
- 1
code/espurna/sensors/EventSensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// Event Counter Sensor
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && EVENTS_SUPPORT


+ 1
- 1
code/espurna/sensors/GUVAS12SDSensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// GUVA-S12SD UV Sensor
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// by Mustafa Tufan
// -----------------------------------------------------------------------------


+ 1
- 1
code/espurna/sensors/HLW8012Sensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// Event Counter Sensor
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && HLW8012_SUPPORT


+ 1
- 1
code/espurna/sensors/I2CSensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// Abstract I2C sensor class (other sensor classes extend this class)
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && ( I2C_SUPPORT || EMON_ANALOG_SUPPORT )


code/espurna/sensors/MAX6675.h → code/espurna/sensors/MAX6675Sensor.h View File

@ -1,7 +1,7 @@
// -----------------------------------------------------------------------------
// MAX6675 Sensor
// Uses MAX6675_Thermocouple library
// Copyright (C) 2017-2018 by Xose Pérez <andrade dot luciano at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <andrade dot luciano at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && MAX6675_SUPPORT
@ -25,7 +25,7 @@ class MAX6675Sensor : public BaseSensor {
MAX6675Sensor(): BaseSensor() {
_sensor_id = SENSOR_MAX6675_ID;
_count = 1;
}
~MAX6675Sensor() {
@ -62,11 +62,9 @@ class MAX6675Sensor : public BaseSensor {
if (!_dirty) return;
//// MAX6675
int units = 1; // Units to readout temp (0 = raw, 1 = ˚C, 2 = ˚F)
int units = 1; // Units to readout temp (0 = raw, 1 = ˚C, 2 = ˚F)
if (_max) delete _max;
_max = new MAX6675(_pin_cs,_pin_so,_pin_sck,units);
_count = 1;
_max = new MAX6675(_pin_cs, _pin_so, _pin_sck, units);
_ready = true;
_dirty = false;
@ -78,24 +76,20 @@ class MAX6675Sensor : public BaseSensor {
static unsigned long last = 0;
if (millis() - last < MAX6675_READ_INTERVAL) return;
last = millis();
last_read = _max->read_temp();
}
// Descriptive name of the sensor
String description() {
char buffer[20];
//snprintf(buffer, sizeof(buffer), "MAX6675 @ CS %d", _gpio);
snprintf(buffer, sizeof(buffer), "MAX6675 ");
snprintf(buffer, sizeof(buffer), "MAX6675");
return String(buffer);
}
String address(unsigned char index){
return String("@ address");
}
String address(unsigned char index) {
return String("@ address");
}
// Address of the device
// Descriptive name of the slot # index
@ -128,7 +122,6 @@ class MAX6675Sensor : public BaseSensor {
// Current value for slot # index
double value(unsigned char index) {
return last_read;
}
protected:
@ -141,7 +134,7 @@ class MAX6675Sensor : public BaseSensor {
unsigned int _pin_so = MAX6675_SO_PIN;
unsigned int _pin_sck = MAX6675_SCK_PIN;
bool _busy = false;
double last_read = 0;
double last_read = 0;
MAX6675 * _max = NULL;

+ 1
- 1
code/espurna/sensors/MHZ19Sensor.h View File

@ -3,7 +3,7 @@
// Based on: https://github.com/nara256/mhz19_uart
// http://www.winsen-sensor.com/d/files/infrared-gas-sensor/mh-z19b-co2-ver1_0.pdf
// Uses SoftwareSerial library
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && MHZ19_SUPPORT


+ 1
- 1
code/espurna/sensors/MICS2710Sensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// MICS-2710 (and MICS-4514) NO2 Analog Sensor
// Copyright (C) 2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && MICS2710_SUPPORT


+ 1
- 1
code/espurna/sensors/MICS5525Sensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// MICS-5525 (and MICS-4514) CO Analog Sensor
// Copyright (C) 2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && MICS5525_SUPPORT


+ 1
- 1
code/espurna/sensors/NTCSensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// NTC Sensor (maps to a NTCSensor)
// Copyright (C) 2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && NTC_SUPPORT


+ 1
- 1
code/espurna/sensors/PZEM004TSensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// PZEM004T based power monitor
// Copyright (C) 2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
// Connection Diagram:


+ 1
- 1
code/espurna/sensors/PulseMeterSensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// Pulse Meter Power Monitor Sensor
// Copyright (C) 2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && PULSEMETER_SUPPORT


+ 1
- 1
code/espurna/sensors/SDS011Sensor.h View File

@ -1,5 +1,5 @@
// -----------------------------------------------------------------------------
// SDS011 particulates sensor
// SDS011 dust sensor
// Based on: https://github.com/ricki-z/SDS011
//
// Uses SoftwareSerial library


+ 1
- 1
code/espurna/sensors/SHT3XI2CSensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// SHT3X Sensor over I2C (Wemos)
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && SHT3X_I2C_SUPPORT


+ 1
- 1
code/espurna/sensors/SI7021Sensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// SI7021 / HTU21D Sensor over I2C
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && SI7021_SUPPORT


+ 1
- 1
code/espurna/sensors/SonarSensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// HC-SR04, SRF05, SRF06, DYP-ME007, JSN-SR04T & Parallax PING)))
// Copyright (C) 2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2019 by Xose Pérez <xose dot perez at gmail dot com>
// Enhancements by Rui Marinho
// -----------------------------------------------------------------------------


+ 1
- 1
code/espurna/sensors/TMP3XSensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// TMP3X Temperature Analog Sensor
// Copyright (C) 2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && TMP3X_SUPPORT


+ 1
- 1
code/espurna/sensors/V9261FSensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// V9261F based power monitor
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && V9261F_SUPPORT


+ 1
- 1
code/espurna/sensors/VEML6075Sensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// VEML6075 Sensor over I2C
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && VEML6075_SUPPORT


+ 1
- 1
code/espurna/sensors/VL53L1XSensor.h View File

@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// VL53L1X Sensor over I2C
// Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
// Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
// -----------------------------------------------------------------------------
#if SENSOR_SUPPORT && VL53L1X_SUPPORT


+ 1
- 1
code/espurna/ssdp.ino View File

@ -2,7 +2,7 @@
SSDP MODULE
Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
Uses SSDP library by PawelDino (https://github.com/PawelDino)
https://github.com/esp8266/Arduino/issues/2283#issuecomment-299635604


+ 3167
- 3154
code/espurna/static/index.all.html.gz.h
File diff suppressed because it is too large
View File


+ 2605
- 2593
code/espurna/static/index.light.html.gz.h
File diff suppressed because it is too large
View File


+ 2199
- 2188
code/espurna/static/index.lightfox.html.gz.h
File diff suppressed because it is too large
View File


+ 2235
- 2223
code/espurna/static/index.rfbridge.html.gz.h
File diff suppressed because it is too large
View File


+ 4127
- 4115
code/espurna/static/index.rfm69.html.gz.h
File diff suppressed because it is too large
View File


+ 2706
- 2695
code/espurna/static/index.sensor.html.gz.h
File diff suppressed because it is too large
View File


+ 2199
- 2188
code/espurna/static/index.small.html.gz.h
File diff suppressed because it is too large
View File


+ 1
- 1
code/espurna/system.ino View File

@ -2,7 +2,7 @@
SYSTEM MODULE
Copyright (C) 2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


+ 1
- 1
code/espurna/telnet.ino View File

@ -2,7 +2,7 @@
TELNET MODULE
Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
Parts of the code have been borrowed from Thomas Sarlandie's NetServer
(https://github.com/sarfata/kbox-firmware/tree/master/src/esp)


+ 1
- 1
code/espurna/thinkspeak.ino View File

@ -2,7 +2,7 @@
THINGSPEAK MODULE
Copyright (C) 2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


+ 1
- 1
code/espurna/utils.ino View File

@ -2,7 +2,7 @@
UTILS MODULE
Copyright (C) 2017-2018 by Xose Pérez <xose dot perez at gmail dot com>
Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
*/


+ 35
- 1
code/html/custom.js View File

@ -249,7 +249,7 @@ function addValue(data, name, value) {
"mqttGroup", "mqttGroupSync", "relayOnDisc",
"dczRelayIdx", "dczMagnitude",
"tspkRelay", "tspkMagnitude",
"ledMode",
"ledMode", "ledRelay",
"adminPass",
"node", "key", "topic"
];
@ -974,6 +974,27 @@ function initRelayConfig(data) {
// Sensors & Magnitudes
// -----------------------------------------------------------------------------
function initLeds(data) {
var current = $("#ledConfig > div").length;
if (current > 0) { return; }
var size = data.length;
var template = $("#ledConfigTemplate").children();
for (var i=0; i<size; ++i) {
var line = $(template).clone();
$("span.id", line).html(i);
$("select", line).attr("data", i);
$("input", line).attr("data", i);
line.appendTo("#ledConfig");
}
}
// -----------------------------------------------------------------------------
// Sensors & Magnitudes
// -----------------------------------------------------------------------------
<!-- removeIf(!sensor)-->
function initMagnitudes(data) {
@ -1493,6 +1514,19 @@ function processData(data) {
return;
}
// ---------------------------------------------------------------------
// LEDs
// ---------------------------------------------------------------------
if ("ledConfig" === key) {
initLeds(value);
for (var i=0; i<value.length; ++i) {
$("select[name='ledMode'][data='" + i + "']", line).val(value[i].mode);
$("input[name='ledRelay'][data='" + i + "']", line).val(value[i].relay);
}
return;
}
// ---------------------------------------------------------------------
// Domoticz
// ---------------------------------------------------------------------


+ 59
- 26
code/html/index.html View File

@ -114,6 +114,10 @@
<a href="#" class="pure-menu-link" data="panel-idb">INFLUXDB</a>
</li>
<li class="pure-menu-item module module-led">
<a href="#" class="pure-menu-link" data="panel-led">LED</a>
</li>
<!-- removeIf(!light) -->
<li class="pure-menu-item module module-color">
<a href="#" class="pure-menu-link" data="panel-color">LIGHTS</a>
@ -373,42 +377,51 @@
</div>
</div>
<div class="pure-g module module-led">
<label class="pure-u-1 pure-u-lg-1-4">LED mode</label>
<select name="ledMode0" class="pure-u-1 pure-u-lg-1-4" tabindex="7">
<option value="1">WiFi status</option>
<option value="8">Relay status</option>
<option value="0">MQTT managed</option>
<option value="4">Find me</option>
<option value="9">Relay &amp; WiFi</option>
<option value="5">Find me &amp; WiFi</option>
<option value="6">Always ON</option>
<option value="7">Always OFF</option>
</select>
<div class="pure-u-0 pure-u-lg-1-2"></div>
<div class="pure-u-0 pure-u-lg-1-4"></div>
<div class="pure-u-1 pure-u-lg-3-4 hint">
This setting defines the behaviour of the main LED in the board.<br />
When in "WiFi status" it will blink at 1Hz when trying to connect. If successfully connected it will briefly blink every 5 seconds if in STA mode or every second if in AP mode.<br />
When in "Relay status" mode the LED will be ON whenever any relay is ON, and OFF otherwise. This is global status notification.<br />
When in "MQTT managed" mode you will be able to set the LED state sending a message to "&lt;base_topic&gt;/led/0/set" with a payload of 0, 1 or 2 (to toggle it).<br />
When in "Find me" mode the LED will be ON when all relays are OFF. This is meant to locate switches at night.<br />
When in "Relay &amp; WiFi" mode it will follow the WiFi status but will stay mostly off when relays are OFF, and mostly ON when any of them is ON.<br />
When in "Find me &amp; WiFi" mode is the opposite of the "Relay &amp; WiFi", it will follow the WiFi status but will stay mostly on when relays are OFF, and mostly OFF when any of them is ON.<br />
"Always ON" and "Always OFF" modes are self-explanatory.
</div>
</div>
<div class="pure-g module module-alexa">
<label class="pure-u-1 pure-u-lg-1-4">Alexa integration</label>
<div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="alexaEnabled" /></div>
</div>
</fieldset>
</div>
</div>
</form>
<form id="form-led" class="pure-form form-settings">
<div class="panel" id="panel-led">
<div class="header">
<h1>LED</h1>
<h2>Notification LED configuration</h2>
</div>
<div class="page">
<fieldset>
<div class="pure-g module module-led">
<div class="pure-u-0 pure-u-lg-1-4">Modes</div>
<div class="pure-u-1 pure-u-lg-3-4 hint">
<li><strong>WiFi status</strong> will blink at 1Hz when trying to connect. If successfully connected it will briefly blink every 5 seconds if in STA mode or every second if in AP mode.</li>
<li><strong>Follow switch</strong> will force the LED to follow the status of a given switch (you must define which switch to follow in the side field).</li>
<li><strong>Inverse switch</strong> will force the LED to not-follow the status of a given switch (you must define which switch to follow in the side field).</li>
<li><strong>Find me</strong> will turn the LED ON when all switches are OFF. This is meant to locate switches at night.</li>
<li><strong>Find me &amp; WiFi</strong> will follow the WiFi status but will stay mostly on when switches are OFF, and mostly OFF when any of them is ON.</li>
<li><strong>Switches status</strong> will turn the LED ON whenever any switch is ON, and OFF otherwise. This is global status notification.</li>
<li><strong>Switches status &amp; WiFi</strong> will follow the WiFi status but will stay mostly off when switches are OFF, and mostly ON when any of them is ON.</li>
<li><strong>MQTT managed</strong> will let you manage the LED status via MQTT by sending a message to "&lt;base_topic&gt;/led/0/set" with a payload of 0, 1 or 2 (to toggle it).</li>
<li><strong>Always ON</strong> and <strong>Always OFF</strong> modes are self-explanatory.</li>
</div>
</div>
<div id="ledConfig"></div>
</fieldset>
</div>
</div>
</form>
<form id="form-relay" class="pure-form form-settings">
<div class="panel" id="panel-relay">
@ -1512,6 +1525,26 @@
<!-- Templates -->
<div id="ledConfigTemplate" class="template">
<div class="pure-g">
<label class="pure-u-1 pure-u-lg-1-4">LED #<span class="id"></span> mode</label>
<select name="ledMode" class="pure-u-1-4">
<option value="1">WiFi status</option>
<option value="2">Follow switch #</option>
<option value="3">Inverse switch #</option>
<option value="4">Find me</option>
<option value="5">Find me &amp; WiFi</option>
<option value="8">Switches status</option>
<option value="9">Switches &amp; WiFi</option>
<option value="0">MQTT managed</option>
<option value="6">Always ON</option>
<option value="7">Always OFF</option>
</select>
&nbsp;
<div class="pure-u-1-4"><input class="pure-u-23-24" name="ledRelay" type="number" min="0" data="0" /></div>
</div>
</div>
<!-- removeIf(!rfbridge) -->
<div id="rfbNodeTemplate" class="template">


+ 2
- 2
code/platformio.ini View File

@ -2457,7 +2457,7 @@ board = ${common.board_1m}
board_build.flash_mode = ${common.flash_mode}
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
build_flags = ${common.build_flags_1m0m} -DESTINK_WIFI_POWER_STRIP
build_flags = ${common.build_flags_1m0m} -DFORNORM_ZLD_34EU
monitor_speed = ${common.monitor_speed}
extra_scripts = ${common.extra_scripts}
@ -2468,7 +2468,7 @@ board = ${common.board_1m}
board_build.flash_mode = ${common.flash_mode}
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
build_flags = ${common.build_flags_1m0m} -DESTINK_WIFI_POWER_STRIP
build_flags = ${common.build_flags_1m0m} -DFORNORM_ZLD_34EU
upload_speed = ${common.upload_speed}
upload_port = ${common.upload_port}
upload_flags = ${common.upload_flags}


BIN
images/devices/blitzwolf-bw-shp6.jpg View File

Before After
Width: 400  |  Height: 400  |  Size: 14 KiB

BIN
images/devices/digoo-nx-sp202.jpg View File

Before After
Width: 400  |  Height: 400  |  Size: 25 KiB

BIN
images/devices/foxel-lightfox-dual.jpg View File

Before After
Width: 400  |  Height: 400  |  Size: 79 KiB

BIN
images/devices/gblife-rgbw-socket.jpg View File

Before After
Width: 400  |  Height: 400  |  Size: 19 KiB

BIN
images/devices/gosund-ws1.jpg View File

Before After
Width: 400  |  Height: 400  |  Size: 23 KiB

BIN
images/devices/green-esp-relay.jpg View File

Before After
Width: 400  |  Height: 400  |  Size: 41 KiB

BIN
images/devices/hama-wifi-steckdose.jpg View File

Before After
Width: 400  |  Height: 400  |  Size: 10 KiB

BIN
images/devices/litesun-la-wf3.jpg View File

Before After
Width: 400  |  Height: 400  |  Size: 11 KiB

BIN
images/devices/lombex-lux-nova2.jpg View File

Before After
Width: 400  |  Height: 400  |  Size: 8.8 KiB

BIN
images/devices/lyasi-rgb-led.jpg View File

Before After
Width: 400  |  Height: 400  |  Size: 12 KiB

BIN
images/devices/maxcio-w-de004.jpg View File

Before After
Width: 400  |  Height: 400  |  Size: 10 KiB

BIN
images/devices/orvibo-b25.jpg View File

Before After
Width: 400  |  Height: 400  |  Size: 11 KiB

BIN
images/devices/oukitel-p1.jpg View File

Before After
Width: 400  |  Height: 400  |  Size: 15 KiB

BIN
images/devices/smartlife-mini-smart-socket.jpg View File

Before After
Width: 400  |  Height: 400  |  Size: 16 KiB

BIN
images/devices/teckin-sp20.jpg View File

Before After
Width: 400  |  Height: 400  |  Size: 7.9 KiB

BIN
images/devices/tonbux-xs-ssa06.jpg View File

Before After
Width: 400  |  Height: 400  |  Size: 7.3 KiB Width: 400  |  Height: 400  |  Size: 13 KiB

BIN
images/devices/wemos-d1-mini-relayshield.jpg View File

Before After
Width: 400  |  Height: 400  |  Size: 30 KiB

BIN
images/devices/wemos-d1-relayshield.jpg View File

Before After
Width: 400  |  Height: 400  |  Size: 23 KiB

Loading…
Cancel
Save