Skip to content

Commit

Permalink
Add support for SenseAir S8 CO2 sensor
Browse files Browse the repository at this point in the history
* Add support for SenseAir S8 CO2 sensor to be enabled with define
USE_SENSEAIR in user_config.h
 * Add support for Domoticz Air Quality
sensor to be used by MH-Z19(B) and SenseAir sensors
  • Loading branch information
arendst committed Dec 22, 2017
1 parent 421c498 commit 7723d52
Show file tree
Hide file tree
Showing 44 changed files with 480 additions and 74 deletions.
9 changes: 5 additions & 4 deletions sonoff/_releasenotes.ino
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/* 5.10.0b
* Add optional support for PZEM004T energy sensor
* Add support for PZEM004T energy sensor to be enabled with define USE_PZEM004T in user_config.h
* Change Sonoff Pow Energy MQTT data message and consolidate Status 8 into Status 10
* Change Wemo SetBinaryState to distinguish from GetBinaryState (#1357)
* Change output of HTTP command to valid JSON only (#1363)
* Change output to valid JSON Array if needed (#1363)
* Add support for sensor MH-Z19(B) to be enabled with define USE_MHZ19 in user_config.h (#561, #1248)
* Change output of HTTP command to valid JSON and Array only (#1363)
* Add support for MH-Z19(B) CO2 sensor to be enabled with define USE_MHZ19 in user_config.h (#561, #1248)
* Add support for senseair S8 CO2 sensor to be enabled with define USE_SENSEAIR in user_config.h
* Add support for Domoticz Air Quality sensor to be used by MH-Z19(B) and SenseAir sensors
*
* 5.10.0a
* Add (experimental) support for sensor SHT3x
Expand Down
6 changes: 5 additions & 1 deletion sonoff/i18n.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
i18n.h - internationalization for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends
Copyright (C) 2018 Theo Arends
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
Expand Down Expand Up @@ -121,6 +121,10 @@ const char HTTP_SNS_PRESSURE[] PROGMEM = "%s{s}%s " D_PRESSURE "{m}%s " D_UNIT_P
const char HTTP_SNS_SEAPRESSURE[] PROGMEM = "%s{s}%s " D_PRESSUREATSEALEVEL "{m}%s " D_UNIT_PRESSURE "{e}"; // {s} = <tr><th>, {m} = </th><td>, {e} = </td></tr>
const char HTTP_SNS_ANALOG[] PROGMEM = "%s{s}%s " D_ANALOG_INPUT "%d{m}%d{e}"; // {s} = <tr><th>, {m} = </th><td>, {e} = </td></tr>

#if defined(USE_MHZ19) || defined(USE_SENSEAIR)
const char HTTP_SNS_CO2[] PROGMEM = "%s{s}%s " D_CO2 "{m}%d " D_UNIT_PPM "{e}"; // {s} = <tr><th>, {m} = </th><td>, {e} = </td></tr>
#endif // USE_WEBSERVER

const char S_MAIN_MENU[] PROGMEM = D_MAIN_MENU;
const char S_CONFIGURATION[] PROGMEM = D_CONFIGURATION;
const char S_CONFIGURE_MODULE[] PROGMEM = D_CONFIGURE_MODULE;
Expand Down
10 changes: 7 additions & 3 deletions sonoff/language/de-DE.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
de-DE.h - localization for German - Germany for Sonoff-Tasmota
Copyright (C) 2017 VinceMasuka
Copyright (C) 2018 VinceMasuka
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
Expand Down Expand Up @@ -66,7 +66,7 @@
#define D_BUTTON "Knopf"
#define D_BY "von" // Written by me
#define D_CELSIUS "Celsius"
#define D_CO2 "CO2"
#define D_CO2 "Kohlenstoffdioxid"
#define D_CODE "code" // Button code
#define D_COLDLIGHT "kalt"
#define D_COMMAND "Befehl"
Expand Down Expand Up @@ -118,6 +118,7 @@
#define D_INITIALIZED "initialisiert"
#define D_IP_ADDRESS "IP-Addresse"
#define D_LIGHT "Licht"
#define D_LIMIT "Grenzwert"
#define D_LOCAL_TIME "lokale Zeit"
#define D_LOW "niedrig"
#define D_LWT "LWT"
Expand Down Expand Up @@ -386,6 +387,7 @@
#define D_DOMOTICZ_COUNT "Count"
#define D_DOMOTICZ_VOLTAGE "Voltage"
#define D_DOMOTICZ_CURRENT "Current"
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
#define D_DOMOTICZ_UPDATE_TIMER "Update timer"

// xdrv_irremote.ino
Expand Down Expand Up @@ -473,12 +475,14 @@
#define D_SENSOR_RELAY "Relay " // Suffix "1i"
#define D_SENSOR_LED "LED " // Suffix "1i"
#define D_SENSOR_PWM "PWM " // Suffix "1"
#define D_SENSOR_COUNTER "Counter" // Suffix "1"
#define D_SENSOR_COUNTER "Counter" // Suffix "1"
#define D_SENSOR_IRRECV "IRRecv"
#define D_SENSOR_MHZ_RX "MHZ Rx"
#define D_SENSOR_MHZ_TX "MHZ Tx"
#define D_SENSOR_PZEM_RX "PZEM Rx"
#define D_SENSOR_PZEM_TX "PZEM Tx"
#define D_SENSOR_SAIR_RX "SAir Rx"
#define D_SENSOR_SAIR_TX "SAir Tx"
#define D_SENSOR_SPI_CS "SPI CS"
#define D_SENSOR_SPI_DC "SPI DC"
#define D_SENSOR_BACKLIGHT "BLight"
Expand Down
8 changes: 6 additions & 2 deletions sonoff/language/en-GB.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
en-GB.h - localization for English - United Kingdom for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends
Copyright (C) 2018 Theo Arends
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
Expand Down Expand Up @@ -66,7 +66,7 @@
#define D_BUTTON "Button"
#define D_BY "by" // Written by me
#define D_CELSIUS "Celsius"
#define D_CO2 "CO2"
#define D_CO2 "Carbon dioxide"
#define D_CODE "code" // Button code
#define D_COLDLIGHT "Cold"
#define D_COMMAND "Command"
Expand Down Expand Up @@ -118,6 +118,7 @@
#define D_INITIALIZED "Initialized"
#define D_IP_ADDRESS "IP Address"
#define D_LIGHT "Light"
#define D_LIMIT "Limit"
#define D_LOCAL_TIME "Local"
#define D_LOW "Low"
#define D_LWT "LWT"
Expand Down Expand Up @@ -386,6 +387,7 @@
#define D_DOMOTICZ_COUNT "Count"
#define D_DOMOTICZ_VOLTAGE "Voltage"
#define D_DOMOTICZ_CURRENT "Current"
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
#define D_DOMOTICZ_UPDATE_TIMER "Update timer"

// xdrv_irremote.ino
Expand Down Expand Up @@ -479,6 +481,8 @@
#define D_SENSOR_MHZ_TX "MHZ Tx"
#define D_SENSOR_PZEM_RX "PZEM Rx"
#define D_SENSOR_PZEM_TX "PZEM Tx"
#define D_SENSOR_SAIR_RX "SAir Rx"
#define D_SENSOR_SAIR_TX "SAir Tx"
#define D_SENSOR_SPI_CS "SPI CS"
#define D_SENSOR_SPI_DC "SPI DC"
#define D_SENSOR_BACKLIGHT "BLight"
Expand Down
10 changes: 7 additions & 3 deletions sonoff/language/nl-NL.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
nl-NL.h - localization for Dutch - Nederland for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends
Copyright (C) 2018 Theo Arends
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
Expand Down Expand Up @@ -66,7 +66,7 @@
#define D_BUTTON "DrukKnop"
#define D_BY "door" // Written by me
#define D_CELSIUS "Celsius"
#define D_CO2 "CO2"
#define D_CO2 "Koolstofdioxide"
#define D_CODE "code" // Button code
#define D_COLDLIGHT "Koud"
#define D_COMMAND "Opdracht"
Expand Down Expand Up @@ -118,6 +118,7 @@
#define D_INITIALIZED "Geinitialiseerd"
#define D_IP_ADDRESS "IP Adres"
#define D_LIGHT "Ligt"
#define D_LIMIT "Grenswaarde"
#define D_LOCAL_TIME "Plaatselijk"
#define D_LOW "Laag"
#define D_LWT "LWT"
Expand Down Expand Up @@ -386,6 +387,7 @@
#define D_DOMOTICZ_COUNT "Count"
#define D_DOMOTICZ_VOLTAGE "Spanning"
#define D_DOMOTICZ_CURRENT "Stroom"
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
#define D_DOMOTICZ_UPDATE_TIMER "Bijwerk timer"

// xdrv_irremote.ino
Expand Down Expand Up @@ -474,11 +476,13 @@
#define D_SENSOR_LED "Led" // Suffix "1i"
#define D_SENSOR_PWM "PWM" // Suffix "1"
#define D_SENSOR_COUNTER "Teller" // Suffix "1"
#define D_SENSOR_IRRECV "IRrecv"
#define D_SENSOR_MHZ_RX "MHZ Rx"
#define D_SENSOR_MHZ_TX "MHZ Tx"
#define D_SENSOR_PZEM_RX "PZEM Rx"
#define D_SENSOR_PZEM_TX "PZEM Tx"
#define D_SENSOR_IRRECV "IRrecv"
#define D_SENSOR_SAIR_RX "SAir Rx"
#define D_SENSOR_SAIR_TX "SAir Tx"
#define D_SENSOR_SPI_CS "SPI CS"
#define D_SENSOR_SPI_DC "SPI DC"
#define D_SENSOR_BACKLIGHT "BLight"
Expand Down
8 changes: 6 additions & 2 deletions sonoff/language/pl-PL.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
pl-PL.h - localization for Polish without fonetick - Poland for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends (translated by roblad - Robert L.)
Copyright (C) 2018 Theo Arends (translated by roblad - Robert L.)
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
Expand Down Expand Up @@ -66,7 +66,7 @@
#define D_BUTTON "Przycisk"
#define D_BY "by" // Written by me
#define D_CELSIUS "Celsiusza"
#define D_CO2 "CO2"
#define D_CO2 "Dwutlenku węgla"
#define D_CODE "kod" // Button code
#define D_COLDLIGHT "Zimny"
#define D_COMMAND "Komenda"
Expand Down Expand Up @@ -118,6 +118,7 @@
#define D_INITIALIZED "Zainicjowany"
#define D_IP_ADDRESS "Adres IP"
#define D_LIGHT "Swiatlo"
#define D_LIMIT "Wartość graniczna"
#define D_LOCAL_TIME "Lokalny"
#define D_LOW "Niski"
#define D_LWT "LWT"
Expand Down Expand Up @@ -386,6 +387,7 @@
#define D_DOMOTICZ_COUNT "Licznik"
#define D_DOMOTICZ_VOLTAGE "Napiecie"
#define D_DOMOTICZ_CURRENT "Prad"
#define D_DOMOTICZ_AIRQUALITY "AirQuality"
#define D_DOMOTICZ_UPDATE_TIMER "Zaktualizuj czasomierz"

// xdrv_irremote.ino
Expand Down Expand Up @@ -479,6 +481,8 @@
#define D_SENSOR_MHZ_TX "MHZ Tx"
#define D_SENSOR_PZEM_RX "PZEM Rx"
#define D_SENSOR_PZEM_TX "PZEM Tx"
#define D_SENSOR_SAIR_RX "SAir Rx"
#define D_SENSOR_SAIR_TX "SAir Tx"
#define D_SENSOR_SPI_CS "SPI CS"
#define D_SENSOR_SPI_DC "SPI DC"
#define D_SENSOR_BACKLIGHT "BLight"
Expand Down
6 changes: 3 additions & 3 deletions sonoff/settings.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
settings.h - setting variables for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends
Copyright (C) 2018 Theo Arends
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
Expand Down Expand Up @@ -201,8 +201,8 @@ struct SYSCFG {
byte free_451[2]; // 451

uint8_t sleep; // 453
uint16_t domoticz_switch_idx[MAX_DOMOTICZ_IDX]; // 454
uint16_t domoticz_sensor_idx[12]; // 45C
uint16_t domoticz_switch_idx[MAX_DOMOTICZ_IDX]; // 454
uint16_t domoticz_sensor_idx[MAX_DOMOTICZ_SNS_IDX]; // 45C
uint8_t module; // 474

uint8_t ws_color[4][3]; // 475
Expand Down
2 changes: 1 addition & 1 deletion sonoff/settings.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
settings.ino - user settings for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends
Copyright (C) 2018 Theo Arends
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
Expand Down
3 changes: 2 additions & 1 deletion sonoff/sonoff.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
sonoff.h - Master header file for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends
Copyright (C) 2018 Theo Arends
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
Expand Down Expand Up @@ -46,6 +46,7 @@ typedef unsigned long power_t; // Power (Relay) type
#define MAX_PULSETIMERS 8 // Max number of supported pulse timers
#define MAX_FRIENDLYNAMES 4 // Max number of Friendly names
#define MAX_DOMOTICZ_IDX 4 // Max number of Domoticz device, key and switch indices
#define MAX_DOMOTICZ_SNS_IDX 12 // Max number of Domoticz sensors indices

#define MODULE SONOFF_BASIC // [Module] Select default model

Expand Down
2 changes: 1 addition & 1 deletion sonoff/sonoff.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
sonoff.ino - Sonoff-Tasmota firmware for iTead Sonoff, Wemos and NodeMCU hardware
Copyright (C) 2017 Theo Arends
Copyright (C) 2018 Theo Arends
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
Expand Down
2 changes: 1 addition & 1 deletion sonoff/sonoff_post.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
sonoff_post.h - Post header file for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends
Copyright (C) 2018 Theo Arends
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
Expand Down
8 changes: 6 additions & 2 deletions sonoff/sonoff_template.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
sonoff_template.h - template settings for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends
Copyright (C) 2018 Theo Arends
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
Expand Down Expand Up @@ -82,6 +82,8 @@ enum UserSelectablePins {
GPIO_MHZ_RXD, // MH-Z19 Serial interface
GPIO_PZEM_TX, // PZEM004T Serial interface
GPIO_PZEM_RX, // PZEM004T Serial interface
GPIO_SAIR_TX, // SenseAir Serial interface
GPIO_SAIR_RX, // SenseAir Serial interface
GPIO_SENSOR_END };

// Text in webpage Module Parameters and commands GPIOS and GPIO
Expand Down Expand Up @@ -145,7 +147,9 @@ const char kSensors[GPIO_SENSOR_END][9] PROGMEM = {
D_SENSOR_MHZ_TX,
D_SENSOR_MHZ_RX,
D_SENSOR_PZEM_TX,
D_SENSOR_PZEM_RX
D_SENSOR_PZEM_RX,
D_SENSOR_SAIR_TX,
D_SENSOR_SAIR_RX
};

// Programmer selectable GPIO functionality offset by user selectable GPIOs
Expand Down
2 changes: 1 addition & 1 deletion sonoff/support.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
support.ino - support for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends
Copyright (C) 2018 Theo Arends
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
Expand Down
5 changes: 3 additions & 2 deletions sonoff/user_config.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
user_config.h - user specific configuration for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends
Copyright (C) 2018 Theo Arends
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
Expand Down Expand Up @@ -192,7 +192,8 @@
#define USE_WS2812_CTYPE 1 // WS2812 Color type (0 - RGB, 1 - GRB, 2 - RGBW, 3 - GRBW)
// #define USE_WS2812_DMA // DMA supports only GPIO03 (= Serial RXD) (+1k mem). When USE_WS2812_DMA is enabled expect Exceptions on Pow

//#define USE_MHZ19 // Add support for MH-Z19 CO2 sensor (+1k8 code)
//#define USE_MHZ19 // Add support for MH-Z19 CO2 sensor (+1k8 code)
//#define USE_SENSEAIR // Add support for SenseAir K30, K70 and S8 CO2 sensor (+1k8 code)

#define USE_ARILUX_RF // Add support for Arilux RF remote controller (+0k8 code)

Expand Down
2 changes: 1 addition & 1 deletion sonoff/user_config_override.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
user_config_override.h - user configuration overrides user_config.h for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends
Copyright (C) 2018 Theo Arends
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
Expand Down
2 changes: 1 addition & 1 deletion sonoff/webserver.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
webserver.ino - webserver for Sonoff-Tasmota
Copyright (C) 2017 Theo Arends
Copyright (C) 2018 Theo Arends
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
Expand Down
Loading

0 comments on commit 7723d52

Please sign in to comment.