mirror of https://github.com/arendst/Tasmota.git
Add support for TX20
Add support for La Crosse TX20 Anemometer (#2654, #3146)
This commit is contained in:
parent
d012ce942b
commit
266f7f1fe0
|
@ -1,5 +1,6 @@
|
|||
/* 6.2.1.18 20181019
|
||||
* Add more API callbacks and document API.md
|
||||
* Add support for La Crosse TX20 Anemometer (#2654, #3146)
|
||||
*
|
||||
* 6.2.1.17 20181017
|
||||
* Enable updated non-blocking PubSubClient as default MQTT client
|
||||
|
|
|
@ -462,6 +462,16 @@
|
|||
#define D_HX_CAL_DONE "Calibrated"
|
||||
#define D_HX_CAL_FAIL "Calibration failed"
|
||||
|
||||
//xsns_35_tx20.ino
|
||||
#define D_TX20_WIND_DIRECTION "Wind Direction"
|
||||
#define D_TX20_WIND_SPEED "Wind Speed"
|
||||
#define D_TX20_WIND_SPEED_AVG "Wind Speed Avg"
|
||||
#define D_TX20_WIND_SPEED_MAX "Wind Speed Max"
|
||||
#define D_TX20_NORTH "N"
|
||||
#define D_TX20_EAST "E"
|
||||
#define D_TX20_SOUTH "S"
|
||||
#define D_TX20_WEST "W"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "Няма"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
|
@ -507,6 +517,8 @@
|
|||
#define D_SENSOR_TM1638_STB "TM16 STB"
|
||||
#define D_SENSOR_HX711_SCK "HX711 SCK"
|
||||
#define D_SENSOR_HX711_DAT "HX711 DAT"
|
||||
#define D_SENSOR_TX20_TX "TX20"
|
||||
#define D_SENSOR_TX20_TX "TX20"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -515,6 +527,7 @@
|
|||
#define D_UNIT_HOUR "h"
|
||||
#define D_UNIT_KILOGRAM "kg"
|
||||
#define D_UNIT_INCREMENTS "inc"
|
||||
#define D_UNIT_KILOMETER_PER_HOUR "kmph" // or "km/h"
|
||||
#define D_UNIT_KILOOHM "kΩ"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
#define D_UNIT_LUX "lx"
|
||||
|
|
|
@ -462,6 +462,16 @@
|
|||
#define D_HX_CAL_DONE "Zkalibrováno"
|
||||
#define D_HX_CAL_FAIL "Chyba kalibrace"
|
||||
|
||||
//xsns_35_tx20.ino
|
||||
#define D_TX20_WIND_DIRECTION "Wind Direction"
|
||||
#define D_TX20_WIND_SPEED "Wind Speed"
|
||||
#define D_TX20_WIND_SPEED_AVG "Wind Speed Avg"
|
||||
#define D_TX20_WIND_SPEED_MAX "Wind Speed Max"
|
||||
#define D_TX20_NORTH "N"
|
||||
#define D_TX20_EAST "E"
|
||||
#define D_TX20_SOUTH "S"
|
||||
#define D_TX20_WEST "W"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "Není"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
|
@ -515,6 +525,7 @@
|
|||
#define D_UNIT_HOUR "hod"
|
||||
#define D_UNIT_KILOGRAM "kg"
|
||||
#define D_UNIT_INCREMENTS "inc"
|
||||
#define D_UNIT_KILOMETER_PER_HOUR "kmph" // or "km/h"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
#define D_UNIT_LUX "lx"
|
||||
|
|
|
@ -462,6 +462,16 @@
|
|||
#define D_HX_CAL_DONE "kalibriert"
|
||||
#define D_HX_CAL_FAIL "Kalibrierung fehlgeschlagen"
|
||||
|
||||
//xsns_35_tx20.ino
|
||||
#define D_TX20_WIND_DIRECTION "Wind Direction"
|
||||
#define D_TX20_WIND_SPEED "Wind Speed"
|
||||
#define D_TX20_WIND_SPEED_AVG "Wind Speed Avg"
|
||||
#define D_TX20_WIND_SPEED_MAX "Wind Speed Max"
|
||||
#define D_TX20_NORTH "N"
|
||||
#define D_TX20_EAST "E"
|
||||
#define D_TX20_SOUTH "S"
|
||||
#define D_TX20_WEST "W"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "None"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
|
@ -507,6 +517,7 @@
|
|||
#define D_SENSOR_TM1638_STB "TM16 STB"
|
||||
#define D_SENSOR_HX711_SCK "HX711 SCK"
|
||||
#define D_SENSOR_HX711_DAT "HX711 DAT"
|
||||
#define D_SENSOR_TX20_TX "TX20"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -515,6 +526,7 @@
|
|||
#define D_UNIT_HOUR "h"
|
||||
#define D_UNIT_INCREMENTS "inc"
|
||||
#define D_UNIT_KILOGRAM "kg"
|
||||
#define D_UNIT_KILOMETER_PER_HOUR "kmph" // or "km/h"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
#define D_UNIT_LUX "lx"
|
||||
|
|
|
@ -462,6 +462,16 @@
|
|||
#define D_HX_CAL_DONE "Calibrated"
|
||||
#define D_HX_CAL_FAIL "Calibration failed"
|
||||
|
||||
//xsns_35_tx20.ino
|
||||
#define D_TX20_WIND_DIRECTION "Wind Direction"
|
||||
#define D_TX20_WIND_SPEED "Wind Speed"
|
||||
#define D_TX20_WIND_SPEED_AVG "Wind Speed Avg"
|
||||
#define D_TX20_WIND_SPEED_MAX "Wind Speed Max"
|
||||
#define D_TX20_NORTH "N"
|
||||
#define D_TX20_EAST "E"
|
||||
#define D_TX20_SOUTH "S"
|
||||
#define D_TX20_WEST "W"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "Κανένας"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
|
@ -507,6 +517,7 @@
|
|||
#define D_SENSOR_TM1638_STB "TM16 STB"
|
||||
#define D_SENSOR_HX711_SCK "HX711 SCK"
|
||||
#define D_SENSOR_HX711_DAT "HX711 DAT"
|
||||
#define D_SENSOR_TX20_TX "TX20"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -515,6 +526,7 @@
|
|||
#define D_UNIT_HOUR "Hr"
|
||||
#define D_UNIT_INCREMENTS "inc"
|
||||
#define D_UNIT_KILOGRAM "kg"
|
||||
#define D_UNIT_KILOMETER_PER_HOUR "kmph" // or "km/h"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
#define D_UNIT_LUX "lx"
|
||||
|
|
|
@ -462,6 +462,16 @@
|
|||
#define D_HX_CAL_DONE "Calibrated"
|
||||
#define D_HX_CAL_FAIL "Calibration failed"
|
||||
|
||||
//xsns_35_tx20.ino
|
||||
#define D_TX20_WIND_DIRECTION "Wind Direction"
|
||||
#define D_TX20_WIND_SPEED "Wind Speed"
|
||||
#define D_TX20_WIND_SPEED_AVG "Wind Speed Avg"
|
||||
#define D_TX20_WIND_SPEED_MAX "Wind Speed Max"
|
||||
#define D_TX20_NORTH "N"
|
||||
#define D_TX20_EAST "E"
|
||||
#define D_TX20_SOUTH "S"
|
||||
#define D_TX20_WEST "W"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "None"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
|
@ -507,6 +517,7 @@
|
|||
#define D_SENSOR_TM1638_STB "TM16 STB"
|
||||
#define D_SENSOR_HX711_SCK "HX711 SCK"
|
||||
#define D_SENSOR_HX711_DAT "HX711 DAT"
|
||||
#define D_SENSOR_TX20_TX "TX20"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -515,6 +526,7 @@
|
|||
#define D_UNIT_HOUR "Hr"
|
||||
#define D_UNIT_INCREMENTS "inc"
|
||||
#define D_UNIT_KILOGRAM "kg"
|
||||
#define D_UNIT_KILOMETER_PER_HOUR "kmph" // or "km/h"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
#define D_UNIT_LUX "lx"
|
||||
|
|
|
@ -462,6 +462,16 @@
|
|||
#define D_HX_CAL_DONE "Calibrado"
|
||||
#define D_HX_CAL_FAIL "Falló Calibración"
|
||||
|
||||
//xsns_35_tx20.ino
|
||||
#define D_TX20_WIND_DIRECTION "Wind Direction"
|
||||
#define D_TX20_WIND_SPEED "Wind Speed"
|
||||
#define D_TX20_WIND_SPEED_AVG "Wind Speed Avg"
|
||||
#define D_TX20_WIND_SPEED_MAX "Wind Speed Max"
|
||||
#define D_TX20_NORTH "N"
|
||||
#define D_TX20_EAST "E"
|
||||
#define D_TX20_SOUTH "S"
|
||||
#define D_TX20_WEST "W"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "Ninguno"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
|
@ -507,6 +517,7 @@
|
|||
#define D_SENSOR_TM1638_STB "TM16 STB"
|
||||
#define D_SENSOR_HX711_SCK "HX711 SCK"
|
||||
#define D_SENSOR_HX711_DAT "HX711 DAT"
|
||||
#define D_SENSOR_TX20_TX "TX20"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -515,6 +526,7 @@
|
|||
#define D_UNIT_HOUR "Hr"
|
||||
#define D_UNIT_INCREMENTS "inc"
|
||||
#define D_UNIT_KILOGRAM "kg"
|
||||
#define D_UNIT_KILOMETER_PER_HOUR "kmph" // or "km/h"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
#define D_UNIT_LUX "lx"
|
||||
|
|
|
@ -462,6 +462,16 @@
|
|||
#define D_HX_CAL_DONE "Calibrated"
|
||||
#define D_HX_CAL_FAIL "Calibration failed"
|
||||
|
||||
//xsns_35_tx20.ino
|
||||
#define D_TX20_WIND_DIRECTION "Wind Direction"
|
||||
#define D_TX20_WIND_SPEED "Wind Speed"
|
||||
#define D_TX20_WIND_SPEED_AVG "Wind Speed Avg"
|
||||
#define D_TX20_WIND_SPEED_MAX "Wind Speed Max"
|
||||
#define D_TX20_NORTH "N"
|
||||
#define D_TX20_EAST "E"
|
||||
#define D_TX20_SOUTH "S"
|
||||
#define D_TX20_WEST "W"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "Aucun"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
|
@ -507,6 +517,7 @@
|
|||
#define D_SENSOR_TM1638_STB "TM16 STB"
|
||||
#define D_SENSOR_HX711_SCK "HX711 SCK"
|
||||
#define D_SENSOR_HX711_DAT "HX711 DAT"
|
||||
#define D_SENSOR_TX20_TX "TX20"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -515,6 +526,7 @@
|
|||
#define D_UNIT_HOUR "h"
|
||||
#define D_UNIT_INCREMENTS "inc"
|
||||
#define D_UNIT_KILOGRAM "kg"
|
||||
#define D_UNIT_KILOMETER_PER_HOUR "kmph" // or "km/h"
|
||||
#define D_UNIT_KILOOHM "kΩ"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
#define D_UNIT_LUX "lx"
|
||||
|
|
|
@ -462,6 +462,16 @@
|
|||
#define D_HX_CAL_DONE "Calibrated"
|
||||
#define D_HX_CAL_FAIL "Calibration failed"
|
||||
|
||||
//xsns_35_tx20.ino
|
||||
#define D_TX20_WIND_DIRECTION "Wind Direction"
|
||||
#define D_TX20_WIND_SPEED "Wind Speed"
|
||||
#define D_TX20_WIND_SPEED_AVG "Wind Speed Avg"
|
||||
#define D_TX20_WIND_SPEED_MAX "Wind Speed Max"
|
||||
#define D_TX20_NORTH "N"
|
||||
#define D_TX20_EAST "E"
|
||||
#define D_TX20_SOUTH "S"
|
||||
#define D_TX20_WEST "W"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "None"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
|
@ -507,6 +517,7 @@
|
|||
#define D_SENSOR_TM1638_STB "TM16 STB"
|
||||
#define D_SENSOR_HX711_SCK "HX711 SCK"
|
||||
#define D_SENSOR_HX711_DAT "HX711 DAT"
|
||||
#define D_SENSOR_TX20_TX "TX20"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -515,6 +526,7 @@
|
|||
#define D_UNIT_HOUR "Hr"
|
||||
#define D_UNIT_INCREMENTS "inc"
|
||||
#define D_UNIT_KILOGRAM "kg"
|
||||
#define D_UNIT_KILOMETER_PER_HOUR "kmph" // or "km/h"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
#define D_UNIT_LUX "lx"
|
||||
|
|
|
@ -462,6 +462,16 @@
|
|||
#define D_HX_CAL_DONE "Calibrated"
|
||||
#define D_HX_CAL_FAIL "Calibration failed"
|
||||
|
||||
//xsns_35_tx20.ino
|
||||
#define D_TX20_WIND_DIRECTION "Wind Direction"
|
||||
#define D_TX20_WIND_SPEED "Wind Speed"
|
||||
#define D_TX20_WIND_SPEED_AVG "Wind Speed Avg"
|
||||
#define D_TX20_WIND_SPEED_MAX "Wind Speed Max"
|
||||
#define D_TX20_NORTH "N"
|
||||
#define D_TX20_EAST "E"
|
||||
#define D_TX20_SOUTH "S"
|
||||
#define D_TX20_WEST "W"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "Nincs"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
|
@ -507,6 +517,7 @@
|
|||
#define D_SENSOR_TM1638_STB "TM16 STB"
|
||||
#define D_SENSOR_HX711_SCK "HX711 SCK"
|
||||
#define D_SENSOR_HX711_DAT "HX711 DAT"
|
||||
#define D_SENSOR_TX20_TX "TX20"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -515,6 +526,7 @@
|
|||
#define D_UNIT_HOUR "ó"
|
||||
#define D_UNIT_INCREMENTS "inc"
|
||||
#define D_UNIT_KILOGRAM "kg"
|
||||
#define D_UNIT_KILOMETER_PER_HOUR "kmph" // or "km/h"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
#define D_UNIT_LUX "lx"
|
||||
|
|
|
@ -462,6 +462,16 @@
|
|||
#define D_HX_CAL_DONE "Calibrated"
|
||||
#define D_HX_CAL_FAIL "Calibration failed"
|
||||
|
||||
//xsns_35_tx20.ino
|
||||
#define D_TX20_WIND_DIRECTION "Wind Direction"
|
||||
#define D_TX20_WIND_SPEED "Wind Speed"
|
||||
#define D_TX20_WIND_SPEED_AVG "Wind Speed Avg"
|
||||
#define D_TX20_WIND_SPEED_MAX "Wind Speed Max"
|
||||
#define D_TX20_NORTH "N"
|
||||
#define D_TX20_EAST "E"
|
||||
#define D_TX20_SOUTH "S"
|
||||
#define D_TX20_WEST "W"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "Nessuno"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
|
@ -507,6 +517,7 @@
|
|||
#define D_SENSOR_TM1638_STB "TM16 STB"
|
||||
#define D_SENSOR_HX711_SCK "HX711 SCK"
|
||||
#define D_SENSOR_HX711_DAT "HX711 DAT"
|
||||
#define D_SENSOR_TX20_TX "TX20"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -515,6 +526,7 @@
|
|||
#define D_UNIT_HOUR "Hr"
|
||||
#define D_UNIT_INCREMENTS "inc"
|
||||
#define D_UNIT_KILOGRAM "kg"
|
||||
#define D_UNIT_KILOMETER_PER_HOUR "kmph" // or "km/h"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
#define D_UNIT_LUX "lx"
|
||||
|
|
|
@ -462,6 +462,16 @@
|
|||
#define D_HX_CAL_DONE "Ge-ijkt"
|
||||
#define D_HX_CAL_FAIL "Ijken is mislukt"
|
||||
|
||||
//xsns_35_tx20.ino
|
||||
#define D_TX20_WIND_DIRECTION "Windrichting"
|
||||
#define D_TX20_WIND_SPEED "Windsnelheid"
|
||||
#define D_TX20_WIND_SPEED_AVG "Windsnelheid gemiddeld"
|
||||
#define D_TX20_WIND_SPEED_MAX "Windsnelhied maximaal"
|
||||
#define D_TX20_NORTH "N"
|
||||
#define D_TX20_EAST "E"
|
||||
#define D_TX20_SOUTH "S"
|
||||
#define D_TX20_WEST "W"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "Geen"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
|
@ -507,6 +517,7 @@
|
|||
#define D_SENSOR_TM1638_STB "TM16 STB"
|
||||
#define D_SENSOR_HX711_SCK "HX711 SCK"
|
||||
#define D_SENSOR_HX711_DAT "HX711 DAT"
|
||||
#define D_SENSOR_TX20_TX "TX20"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -515,6 +526,7 @@
|
|||
#define D_UNIT_HOUR "h"
|
||||
#define D_UNIT_INCREMENTS "inc"
|
||||
#define D_UNIT_KILOGRAM "kg"
|
||||
#define D_UNIT_KILOMETER_PER_HOUR "kmph" // or "km/h"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
#define D_UNIT_LUX "lx"
|
||||
|
|
|
@ -462,6 +462,16 @@
|
|||
#define D_HX_CAL_DONE "Calibrated"
|
||||
#define D_HX_CAL_FAIL "Calibration failed"
|
||||
|
||||
//xsns_35_tx20.ino
|
||||
#define D_TX20_WIND_DIRECTION "Wind Direction"
|
||||
#define D_TX20_WIND_SPEED "Wind Speed"
|
||||
#define D_TX20_WIND_SPEED_AVG "Wind Speed Avg"
|
||||
#define D_TX20_WIND_SPEED_MAX "Wind Speed Max"
|
||||
#define D_TX20_NORTH "N"
|
||||
#define D_TX20_EAST "E"
|
||||
#define D_TX20_SOUTH "S"
|
||||
#define D_TX20_WEST "W"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "Brak"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
|
@ -507,6 +517,7 @@
|
|||
#define D_SENSOR_TM1638_STB "TM16 STB"
|
||||
#define D_SENSOR_HX711_SCK "HX711 SCK"
|
||||
#define D_SENSOR_HX711_DAT "HX711 DAT"
|
||||
#define D_SENSOR_TX20_TX "TX20"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -515,6 +526,7 @@
|
|||
#define D_UNIT_HOUR "Godz"
|
||||
#define D_UNIT_INCREMENTS "inc"
|
||||
#define D_UNIT_KILOGRAM "kg"
|
||||
#define D_UNIT_KILOMETER_PER_HOUR "kmph" // or "km/h"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
#define D_UNIT_LUX "lx"
|
||||
|
|
|
@ -462,6 +462,16 @@
|
|||
#define D_HX_CAL_DONE "Calibrated"
|
||||
#define D_HX_CAL_FAIL "Calibration failed"
|
||||
|
||||
//xsns_35_tx20.ino
|
||||
#define D_TX20_WIND_DIRECTION "Wind Direction"
|
||||
#define D_TX20_WIND_SPEED "Wind Speed"
|
||||
#define D_TX20_WIND_SPEED_AVG "Wind Speed Avg"
|
||||
#define D_TX20_WIND_SPEED_MAX "Wind Speed Max"
|
||||
#define D_TX20_NORTH "N"
|
||||
#define D_TX20_EAST "E"
|
||||
#define D_TX20_SOUTH "S"
|
||||
#define D_TX20_WEST "W"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "Nenhum"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
|
@ -507,6 +517,7 @@
|
|||
#define D_SENSOR_TM1638_STB "TM16 STB"
|
||||
#define D_SENSOR_HX711_SCK "HX711 SCK"
|
||||
#define D_SENSOR_HX711_DAT "HX711 DAT"
|
||||
#define D_SENSOR_TX20_TX "TX20"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -515,6 +526,7 @@
|
|||
#define D_UNIT_HOUR "H"
|
||||
#define D_UNIT_INCREMENTS "inc"
|
||||
#define D_UNIT_KILOGRAM "kg"
|
||||
#define D_UNIT_KILOMETER_PER_HOUR "kmph" // or "km/h"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
#define D_UNIT_LUX "lx"
|
||||
|
|
|
@ -462,6 +462,16 @@
|
|||
#define D_HX_CAL_DONE "Calibrated"
|
||||
#define D_HX_CAL_FAIL "Calibration failed"
|
||||
|
||||
//xsns_35_tx20.ino
|
||||
#define D_TX20_WIND_DIRECTION "Wind Direction"
|
||||
#define D_TX20_WIND_SPEED "Wind Speed"
|
||||
#define D_TX20_WIND_SPEED_AVG "Wind Speed Avg"
|
||||
#define D_TX20_WIND_SPEED_MAX "Wind Speed Max"
|
||||
#define D_TX20_NORTH "N"
|
||||
#define D_TX20_EAST "E"
|
||||
#define D_TX20_SOUTH "S"
|
||||
#define D_TX20_WEST "W"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "Nenhum"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
|
@ -507,6 +517,7 @@
|
|||
#define D_SENSOR_TM1638_STB "TM16 STB"
|
||||
#define D_SENSOR_HX711_SCK "HX711 SCK"
|
||||
#define D_SENSOR_HX711_DAT "HX711 DAT"
|
||||
#define D_SENSOR_TX20_TX "TX20"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -515,6 +526,7 @@
|
|||
#define D_UNIT_HOUR "Hr"
|
||||
#define D_UNIT_INCREMENTS "inc"
|
||||
#define D_UNIT_KILOGRAM "kg"
|
||||
#define D_UNIT_KILOMETER_PER_HOUR "kmph" // or "km/h"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
#define D_UNIT_LUX "lx"
|
||||
|
|
|
@ -462,6 +462,16 @@
|
|||
#define D_HX_CAL_DONE "Calibrated"
|
||||
#define D_HX_CAL_FAIL "Calibration failed"
|
||||
|
||||
//xsns_35_tx20.ino
|
||||
#define D_TX20_WIND_DIRECTION "Wind Direction"
|
||||
#define D_TX20_WIND_SPEED "Wind Speed"
|
||||
#define D_TX20_WIND_SPEED_AVG "Wind Speed Avg"
|
||||
#define D_TX20_WIND_SPEED_MAX "Wind Speed Max"
|
||||
#define D_TX20_NORTH "N"
|
||||
#define D_TX20_EAST "E"
|
||||
#define D_TX20_SOUTH "S"
|
||||
#define D_TX20_WEST "W"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "-нет-"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
|
@ -507,6 +517,7 @@
|
|||
#define D_SENSOR_TM1638_STB "TM16 STB"
|
||||
#define D_SENSOR_HX711_SCK "HX711 SCK"
|
||||
#define D_SENSOR_HX711_DAT "HX711 DAT"
|
||||
#define D_SENSOR_TX20_TX "TX20"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "А"
|
||||
|
@ -515,6 +526,7 @@
|
|||
#define D_UNIT_HOUR "Ч"
|
||||
#define D_UNIT_INCREMENTS "inc"
|
||||
#define D_UNIT_KILOGRAM "kg"
|
||||
#define D_UNIT_KILOMETER_PER_HOUR "kmph" // or "km/h"
|
||||
#define D_UNIT_KILOOHM "кОм"
|
||||
#define D_UNIT_KILOWATTHOUR "кВт"
|
||||
#define D_UNIT_LUX "лк"
|
||||
|
|
|
@ -462,6 +462,16 @@
|
|||
#define D_HX_CAL_DONE "Calibrated"
|
||||
#define D_HX_CAL_FAIL "Calibration failed"
|
||||
|
||||
//xsns_35_tx20.ino
|
||||
#define D_TX20_WIND_DIRECTION "Wind Direction"
|
||||
#define D_TX20_WIND_SPEED "Wind Speed"
|
||||
#define D_TX20_WIND_SPEED_AVG "Wind Speed Avg"
|
||||
#define D_TX20_WIND_SPEED_MAX "Wind Speed Max"
|
||||
#define D_TX20_NORTH "N"
|
||||
#define D_TX20_EAST "E"
|
||||
#define D_TX20_SOUTH "S"
|
||||
#define D_TX20_WEST "W"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "None"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
|
@ -507,6 +517,7 @@
|
|||
#define D_SENSOR_TM1638_STB "TM16 STB"
|
||||
#define D_SENSOR_HX711_SCK "HX711 SCK"
|
||||
#define D_SENSOR_HX711_DAT "HX711 DAT"
|
||||
#define D_SENSOR_TX20_TX "TX20"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -514,6 +525,7 @@
|
|||
#define D_UNIT_HOUR "Hr"
|
||||
#define D_UNIT_INCREMENTS "inc"
|
||||
#define D_UNIT_KILOGRAM "kg"
|
||||
#define D_UNIT_KILOMETER_PER_HOUR "kmph" // or "km/h"
|
||||
#define D_UNIT_KILOOHM "kOhm"
|
||||
#define D_UNIT_KILOWATTHOUR "kWh"
|
||||
#define D_UNIT_LUX "lx"
|
||||
|
|
|
@ -462,6 +462,16 @@
|
|||
#define D_HX_CAL_DONE "Calibrated"
|
||||
#define D_HX_CAL_FAIL "Calibration failed"
|
||||
|
||||
//xsns_35_tx20.ino
|
||||
#define D_TX20_WIND_DIRECTION "Wind Direction"
|
||||
#define D_TX20_WIND_SPEED "Wind Speed"
|
||||
#define D_TX20_WIND_SPEED_AVG "Wind Speed Avg"
|
||||
#define D_TX20_WIND_SPEED_MAX "Wind Speed Max"
|
||||
#define D_TX20_NORTH "N"
|
||||
#define D_TX20_EAST "E"
|
||||
#define D_TX20_SOUTH "S"
|
||||
#define D_TX20_WEST "W"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "-відсутньо-"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
|
@ -507,6 +517,7 @@
|
|||
#define D_SENSOR_TM1638_STB "TM16 STB"
|
||||
#define D_SENSOR_HX711_SCK "HX711 SCK"
|
||||
#define D_SENSOR_HX711_DAT "HX711 DAT"
|
||||
#define D_SENSOR_TX20_TX "TX20"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "А"
|
||||
|
@ -515,6 +526,7 @@
|
|||
#define D_UNIT_HOUR "Г"
|
||||
#define D_UNIT_INCREMENTS "inc"
|
||||
#define D_UNIT_KILOGRAM "kg"
|
||||
#define D_UNIT_KILOMETER_PER_HOUR "kmph" // or "km/h"
|
||||
#define D_UNIT_KILOOHM "кОм"
|
||||
#define D_UNIT_KILOWATTHOUR "кВт"
|
||||
#define D_UNIT_LUX "лк"
|
||||
|
|
|
@ -462,6 +462,16 @@
|
|||
#define D_HX_CAL_DONE "Calibrated"
|
||||
#define D_HX_CAL_FAIL "Calibration failed"
|
||||
|
||||
//xsns_35_tx20.ino
|
||||
#define D_TX20_WIND_DIRECTION "Wind Direction"
|
||||
#define D_TX20_WIND_SPEED "Wind Speed"
|
||||
#define D_TX20_WIND_SPEED_AVG "Wind Speed Avg"
|
||||
#define D_TX20_WIND_SPEED_MAX "Wind Speed Max"
|
||||
#define D_TX20_NORTH "N"
|
||||
#define D_TX20_EAST "E"
|
||||
#define D_TX20_SOUTH "S"
|
||||
#define D_TX20_WEST "W"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "无"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
|
@ -507,6 +517,7 @@
|
|||
#define D_SENSOR_TM1638_STB "TM16 STB"
|
||||
#define D_SENSOR_HX711_SCK "HX711 SCK"
|
||||
#define D_SENSOR_HX711_DAT "HX711 DAT"
|
||||
#define D_SENSOR_TX20_TX "TX20"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "安"
|
||||
|
@ -514,6 +525,7 @@
|
|||
#define D_UNIT_HOUR "时"
|
||||
#define D_UNIT_INCREMENTS "inc"
|
||||
#define D_UNIT_KILOGRAM "kg"
|
||||
#define D_UNIT_KILOMETER_PER_HOUR "kmph" // or "km/h"
|
||||
#define D_UNIT_KILOOHM "千欧"
|
||||
#define D_UNIT_KILOWATTHOUR "千瓦时"
|
||||
#define D_UNIT_LUX "勒克斯"
|
||||
|
|
|
@ -462,6 +462,16 @@
|
|||
#define D_HX_CAL_DONE "Calibrated"
|
||||
#define D_HX_CAL_FAIL "Calibration failed"
|
||||
|
||||
//xsns_35_tx20.ino
|
||||
#define D_TX20_WIND_DIRECTION "Wind Direction"
|
||||
#define D_TX20_WIND_SPEED "Wind Speed"
|
||||
#define D_TX20_WIND_SPEED_AVG "Wind Speed Avg"
|
||||
#define D_TX20_WIND_SPEED_MAX "Wind Speed Max"
|
||||
#define D_TX20_NORTH "N"
|
||||
#define D_TX20_EAST "E"
|
||||
#define D_TX20_SOUTH "S"
|
||||
#define D_TX20_WEST "W"
|
||||
|
||||
// sonoff_template.h
|
||||
#define D_SENSOR_NONE "None"
|
||||
#define D_SENSOR_DHT11 "DHT11"
|
||||
|
@ -507,6 +517,7 @@
|
|||
#define D_SENSOR_TM1638_STB "TM16 STB"
|
||||
#define D_SENSOR_HX711_SCK "HX711 SCK"
|
||||
#define D_SENSOR_HX711_DAT "HX711 DAT"
|
||||
#define D_SENSOR_TX20_TX "TX20"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "安"
|
||||
|
@ -515,6 +526,7 @@
|
|||
#define D_UNIT_HOUR "時"
|
||||
#define D_UNIT_INCREMENTS "inc"
|
||||
#define D_UNIT_KILOGRAM "kg"
|
||||
#define D_UNIT_KILOMETER_PER_HOUR "kmph" // or "km/h"
|
||||
#define D_UNIT_KILOOHM "千歐"
|
||||
#define D_UNIT_KILOWATTHOUR "千瓦時"
|
||||
#define D_UNIT_LUX "勒克斯"
|
||||
|
|
|
@ -128,6 +128,7 @@ enum UserSelectablePins {
|
|||
GPIO_SDS0X1_TX, // Nova Fitness SDS011 Serial interface
|
||||
GPIO_HX711_SCK, // HX711 Load Cell clock
|
||||
GPIO_HX711_DAT, // HX711 Load Cell data
|
||||
GPIO_TX20_TXD_BLACK, // TX20 Transmission Pin
|
||||
GPIO_SENSOR_END };
|
||||
|
||||
// Programmer selectable GPIO functionality offset by user selectable GPIOs
|
||||
|
@ -182,7 +183,8 @@ const char kSensorNames[] PROGMEM =
|
|||
D_SENSOR_COUNTER "1n|" D_SENSOR_COUNTER "2n|" D_SENSOR_COUNTER "3n|" D_SENSOR_COUNTER "4n|"
|
||||
D_SENSOR_PZEM016_RX "|" D_SENSOR_PZEM017_RX "|"
|
||||
D_SENSOR_DFR562 "|" D_SENSOR_SDS0X1_TX "|"
|
||||
D_SENSOR_HX711_SCK "|" D_SENSOR_HX711_DAT;
|
||||
D_SENSOR_HX711_SCK "|" D_SENSOR_HX711_DAT "|"
|
||||
D_SENSOR_TX20_TX;
|
||||
|
||||
/********************************************************************************************/
|
||||
|
||||
|
@ -363,6 +365,7 @@ const uint8_t kGpioNiceList[GPIO_SENSOR_END] PROGMEM = {
|
|||
GPIO_SDM630_TX, // SDM630 Serial interface
|
||||
GPIO_SDM630_RX, // SDM630 Serial interface
|
||||
GPIO_PMS5003, // Plantower PMS5003 Serial interface
|
||||
GPIO_TX20_TXD_BLACK, // TX20 Transmission Pin
|
||||
GPIO_MP3_DFR562 // RB-DFR-562, DFPlayer Mini MP3 Player Serial interface
|
||||
};
|
||||
|
||||
|
|
|
@ -1013,6 +1013,12 @@ void GetFeatures()
|
|||
#ifdef USE_MP3_PLAYER
|
||||
feature_drv2 |= 0x00002000; // xdrv_14_mp3.ino
|
||||
#endif
|
||||
#ifdef USE_PCA9685
|
||||
feature_drv2 |= 0x00004000; // xdrv_15_pca9685.ino
|
||||
#endif
|
||||
#ifdef USE_TUYA_DIMMER
|
||||
feature_drv2 |= 0x00008000; // xdrv_16_tuyadimmer.ino
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef NO_EXTRA_4K_HEAP
|
||||
|
@ -1186,6 +1192,11 @@ void GetFeatures()
|
|||
#ifdef USE_PZEM_DC
|
||||
feature_sns2 |= 0x00001000; // xnrg_06_pzem_dc.ino
|
||||
#endif
|
||||
#ifdef USE_TX20_WIND_SENSOR
|
||||
feature_sns2 |= 0x00002000; // xsns_35_tx20.ino
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -381,6 +381,8 @@
|
|||
#define USE_TUYA_DIMMER // Add support for Tuya Serial Dimmer
|
||||
#define TUYA_DIMMER_ID 3 // Default dimmer Id
|
||||
|
||||
#define USE_TX20_WIND_SENSOR // Add support for La Crosse TX20 anemometer (+2k code)
|
||||
|
||||
/*********************************************************************************************\
|
||||
* Debug features are only supported in development branch
|
||||
\*********************************************************************************************/
|
||||
|
|
|
@ -0,0 +1,224 @@
|
|||
/*
|
||||
xsns_35_Tx20.ino - La Crosse Tx20 wind sensor support for Sonoff-Tasmota
|
||||
|
||||
Copyright (C) 2018 Thomas Eckerstorfer and 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
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef USE_TX20_WIND_SENSOR
|
||||
/*********************************************************************************************\
|
||||
* La Crosse Tx20 wind sensor
|
||||
*
|
||||
* based on https://github.com/bunnyhu/ESP8266_TX20_wind_sensor/
|
||||
* http://blog.bubux.de/windsensor-tx20-mit-esp8266/
|
||||
* https://www.john.geek.nz/2011/07/la-crosse-tx20-anemometer-communication-protocol/
|
||||
\*********************************************************************************************/
|
||||
|
||||
#define TX20_BIT_TIME 1220 // microseconds
|
||||
#define TX20_RESET_VALUES 60 // seconds
|
||||
|
||||
// The Arduino standard GPIO routines are not enough,
|
||||
// must use some from the Espressif SDK as well
|
||||
extern "C" {
|
||||
#include "gpio.h"
|
||||
}
|
||||
|
||||
#ifdef USE_WEBSERVER
|
||||
|
||||
const char HTTP_SNS_TX20[] PROGMEM = "%s"
|
||||
"{s} " D_TX20_WIND_SPEED "{m}%s " D_UNIT_KILOMETER_PER_HOUR "{e}"
|
||||
"{s} " D_TX20_WIND_SPEED_AVG "{m}%s " D_UNIT_KILOMETER_PER_HOUR "{e}"
|
||||
"{s} " D_TX20_WIND_SPEED_MAX "{m}%s " D_UNIT_KILOMETER_PER_HOUR "{e}"
|
||||
"{s} " D_TX20_WIND_DIRECTION "{m}%s {e}";
|
||||
|
||||
#endif // USE_WEBSERVER
|
||||
|
||||
const char kTx20Directions[] PROGMEM = D_TX20_NORTH "|"
|
||||
D_TX20_NORTH D_TX20_NORTH D_TX20_EAST "|"
|
||||
D_TX20_NORTH D_TX20_EAST "|"
|
||||
D_TX20_EAST D_TX20_NORTH D_TX20_EAST "|"
|
||||
D_TX20_EAST "|"
|
||||
D_TX20_EAST D_TX20_SOUTH D_TX20_EAST "|"
|
||||
D_TX20_SOUTH D_TX20_EAST "|"
|
||||
D_TX20_SOUTH D_TX20_SOUTH D_TX20_EAST "|"
|
||||
D_TX20_SOUTH "|"
|
||||
D_TX20_SOUTH D_TX20_SOUTH D_TX20_WEST "|"
|
||||
D_TX20_SOUTH D_TX20_WEST "|"
|
||||
D_TX20_WEST D_TX20_SOUTH D_TX20_WEST "|"
|
||||
D_TX20_WEST "|"
|
||||
D_TX20_WEST D_TX20_NORTH D_TX20_WEST "|"
|
||||
D_TX20_NORTH D_TX20_WEST "|"
|
||||
D_TX20_NORTH D_TX20_NORTH D_TX20_WEST;
|
||||
|
||||
uint8_t tx20_sa = 0;
|
||||
uint8_t tx20_sb = 0;
|
||||
uint8_t tx20_sd = 0;
|
||||
uint8_t tx20_se = 0;
|
||||
uint16_t tx20_sc = 0;
|
||||
uint16_t tx20_sf = 0;
|
||||
|
||||
float tx20_wind_speed_kmh = 0;
|
||||
float tx20_wind_speed_max = 0;
|
||||
float tx20_wind_speed_avg = 0;
|
||||
float tx20_wind_sum = 0;
|
||||
int tx20_count = 0;
|
||||
uint8_t tx20_wind_direction = 0;
|
||||
|
||||
boolean tx20_available = false;
|
||||
|
||||
void Tx20StartRead()
|
||||
{
|
||||
/* La Crosse TX20 Anemometer datagram every 2 seconds
|
||||
* 0-0 11011 0011 111010101111 0101 1100 000101010000 0-0 - Received pin data at 1200 uSec per bit
|
||||
* sa sb sc sd se sf
|
||||
* 00100 1100 000101010000 1010 1100 000101010000 - sa to sd inverted user data, LSB first
|
||||
* sa - Start frame always 00100
|
||||
* sb - Wind direction 0 - 15
|
||||
* sc - Wind speed 0 - 511
|
||||
* sd - Checksum
|
||||
* se - Wind direction 0 - 15
|
||||
* sf - Wind speed 0 - 511
|
||||
*/
|
||||
|
||||
tx20_available = false;
|
||||
|
||||
tx20_sa = 0;
|
||||
tx20_sb = 0;
|
||||
tx20_sd = 0;
|
||||
tx20_se = 0;
|
||||
tx20_sc = 0;
|
||||
tx20_sf = 0;
|
||||
|
||||
delayMicroseconds(TX20_BIT_TIME / 2);
|
||||
|
||||
for (int bitcount = 41; bitcount > 0; bitcount--) {
|
||||
uint8_t dpin = (digitalRead(pin[GPIO_TX20_TXD_BLACK]));
|
||||
if (bitcount > 41 - 5) {
|
||||
// start, inverted
|
||||
tx20_sa = (tx20_sa << 1) | (dpin ^ 1);
|
||||
} else if (bitcount > 41 - 5 - 4) {
|
||||
// wind dir, inverted
|
||||
tx20_sb = tx20_sb >> 1 | ((dpin ^ 1) << 3);
|
||||
} else if (bitcount > 41 - 5 - 4 - 12) {
|
||||
// windspeed, inverted
|
||||
tx20_sc = tx20_sc >> 1 | ((dpin ^ 1) << 11);
|
||||
} else if (bitcount > 41 - 5 - 4 - 12 - 4) {
|
||||
// checksum, inverted
|
||||
tx20_sd = tx20_sd >> 1 | ((dpin ^ 1) << 3);
|
||||
} else if (bitcount > 41 - 5 - 4 - 12 - 4 - 4) {
|
||||
// wind dir
|
||||
tx20_se = tx20_se >> 1 | (dpin << 3);
|
||||
} else {
|
||||
// windspeed
|
||||
tx20_sf = tx20_sf >> 1 | (dpin << 11);
|
||||
}
|
||||
|
||||
delayMicroseconds(TX20_BIT_TIME);
|
||||
}
|
||||
|
||||
uint8_t chk = (tx20_sb + (tx20_sc & 0xf) + ((tx20_sc >> 4) & 0xf) + ((tx20_sc >> 8) & 0xf));
|
||||
chk &= 0xf;
|
||||
|
||||
if ((chk == tx20_sd) && (tx20_sc < 400)) { // if checksum seems to be ok and wind speed below 40 m/s
|
||||
tx20_available = true;
|
||||
}
|
||||
/*
|
||||
if ((tx20_sb == tx20_se) && (tx20_sc == tx20_sf) && (tx20_sc < 400)) {
|
||||
tx20_available = true;
|
||||
}
|
||||
*/
|
||||
// Must clear this bit in the interrupt register,
|
||||
// it gets set even when interrupts are disabled
|
||||
GPIO_REG_WRITE(GPIO_STATUS_W1TC_ADDRESS, 1 << pin[GPIO_TX20_TXD_BLACK]);
|
||||
}
|
||||
|
||||
void Tx20Read()
|
||||
{
|
||||
if (!(uptime % TX20_RESET_VALUES)) {
|
||||
tx20_count = 0;
|
||||
tx20_wind_sum = 0;
|
||||
tx20_wind_speed_max = 0;
|
||||
}
|
||||
else if (tx20_available) {
|
||||
tx20_wind_speed_kmh = float(tx20_sc) * 0.36;
|
||||
if (tx20_wind_speed_kmh > tx20_wind_speed_max) {
|
||||
tx20_wind_speed_max = tx20_wind_speed_kmh;
|
||||
}
|
||||
tx20_count++;
|
||||
tx20_wind_sum += tx20_wind_speed_kmh;
|
||||
tx20_wind_speed_avg = tx20_wind_sum / tx20_count;
|
||||
tx20_wind_direction = tx20_sb;
|
||||
}
|
||||
}
|
||||
|
||||
void Tx20Init() {
|
||||
pinMode(pin[GPIO_TX20_TXD_BLACK], INPUT);
|
||||
attachInterrupt(pin[GPIO_TX20_TXD_BLACK], Tx20StartRead, RISING);
|
||||
}
|
||||
|
||||
void Tx20Show(boolean json)
|
||||
{
|
||||
char wind_speed_string[10];
|
||||
char wind_speed_max_string[10];
|
||||
char wind_speed_avg_string[10];
|
||||
char wind_direction_string[4];
|
||||
|
||||
dtostrfd(tx20_wind_speed_kmh, 2, wind_speed_string);
|
||||
dtostrfd(tx20_wind_speed_max, 2, wind_speed_max_string);
|
||||
dtostrfd(tx20_wind_speed_avg, 2, wind_speed_avg_string);
|
||||
GetTextIndexed(wind_direction_string, sizeof(wind_direction_string), tx20_wind_direction, kTx20Directions);
|
||||
|
||||
if (json) {
|
||||
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"TX20\":{\"Speed\":%s,\"SpeedAvg\":%s,\"SpeedMax\":%s,\"Direction\":\"%s\"}"),
|
||||
mqtt_data, wind_speed_string, wind_speed_avg_string, wind_speed_max_string, wind_direction_string);
|
||||
#ifdef USE_WEBSERVER
|
||||
} else {
|
||||
snprintf_P(mqtt_data, sizeof(mqtt_data), HTTP_SNS_TX20, mqtt_data, wind_speed_string, wind_speed_avg_string, wind_speed_max_string, wind_direction_string);
|
||||
#endif // USE_WEBSERVER
|
||||
}
|
||||
}
|
||||
|
||||
/*********************************************************************************************\
|
||||
* Interface
|
||||
\*********************************************************************************************/
|
||||
|
||||
#define XSNS_35
|
||||
|
||||
boolean Xsns35(byte function)
|
||||
{
|
||||
boolean result = false;
|
||||
|
||||
if (pin[GPIO_TX20_TXD_BLACK] < 99) {
|
||||
switch (function) {
|
||||
case FUNC_INIT:
|
||||
Tx20Init();
|
||||
break;
|
||||
case FUNC_EVERY_SECOND:
|
||||
Tx20Read();
|
||||
break;
|
||||
case FUNC_JSON_APPEND:
|
||||
Tx20Show(1);
|
||||
break;
|
||||
#ifdef USE_WEBSERVER
|
||||
case FUNC_WEB_APPEND:
|
||||
Tx20Show(0);
|
||||
break;
|
||||
#endif // USE_WEBSERVER
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif // USE_TX20_WIND_SENSOR
|
|
@ -110,7 +110,7 @@ a_features = [[
|
|||
"USE_CONFIG_OVERRIDE","BE_MINIMAL","USE_SENSORS","USE_CLASSIC",
|
||||
"USE_KNX_NO_EMULATION","USE_DISPLAY_MODES1TO5","USE_DISPLAY_GRAPH","USE_DISPLAY_LCD",
|
||||
"USE_DISPLAY_SSD1306","USE_DISPLAY_MATRIX","USE_DISPLAY_ILI9341","USE_DISPLAY_EPAPER",
|
||||
"USE_DISPLAY_SH1106","USE_MP3_PLAYER","","",
|
||||
"USE_DISPLAY_SH1106","USE_MP3_PLAYER","USE_PCA9685","USE_TUYA_DIMMER",
|
||||
"","","","",
|
||||
"","","","NO_EXTRA_4K_HEAP",
|
||||
"VTABLES_IN_IRAM","VTABLES_IN_DRAM","VTABLES_IN_FLASH","PIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH",
|
||||
|
@ -128,7 +128,7 @@ a_features = [[
|
|||
"USE_MCP230xx","USE_MPR121","USE_CCS811","USE_MPU6050",
|
||||
"USE_MCP230xx_OUTPUT","USE_MCP230xx_DISPLAYOUTPUT","USE_HLW8012","USE_CSE7766",
|
||||
"USE_MCP39F501","USE_PZEM_AC","USE_DS3231","USE_HX711",
|
||||
"USE_PZEM_DC","","","",
|
||||
"USE_PZEM_DC","USE_TX20_WIND_SENSOR","","",
|
||||
"","","","",
|
||||
"","","","",
|
||||
"","","","",
|
||||
|
|
Loading…
Reference in New Issue