Max Prokhorov
cae50fa544
sensor/emon: refactoring ( #2213 )
- Update sensor classes to support a generic way to store energy values
- Update sensor conversion code to deal with units and not magnitudes
- Add magnitude<->unit for sensors, generic way of defining used unit. Convert from sensor magnitude unit to the one used for display.
- Reset energy value based on index through external means (MQTT, HTTP)
- Rework energy timestamping, update webui with 'last saved' value
While this solves the energy conversion issues and we are finally seeing the real value, what I don't really like:
- KilowattHour and WattHour are separate enum tags, thus sort-of are different types altogether
- Conversion code in Energy object should probably use some generic 'ratio' calculation? (https://en.cppreference.com/w/cpp/numeric/ratio/ratio )
- We are still using runtime checks to do calculations and depend that sensor outputs only one specific value type.
Consider this a fix for energy display / storage and preliminary work on sensor.ino
Further sensor refactoring... soon.
4 years ago
Xose Pérez
d00c2b5eb3
Fix energy storage when units different from joules
5 years ago
Craig Markwardt
8d52078bcb
Modify BaseSensor so that each sensor knows number of decimals to represent its magnitude types; update sensor.ino to take advantage of this knowledge; sensors BMX280 and Dallas OneWire are updated with this knowledge; tested with BME280 and Dallas DS18B20 sensors
5 years ago
Xose Pérez
546c8f09b2
Update Copyright notice
5 years ago
Maxim Prokhorov
fab9c0f741
Force to implement BaseSensor methods that return values
6 years ago
Xose Pérez
fba8a9f45f
Handle events in EventSensor
6 years ago
Xose Pérez
0e6f2d1ca3
Preliminary support for CSE7766 (Sonoff S31 & Sonoff POW R2)
6 years ago
Xose Pérez
26a087dd7c
Check init status of sensors and re-init if they fail on boot ( #353 )
6 years ago
Xose Pérez
4029ee73da
Trying to fix some issues reported by codacy
6 years ago
Xose Pérez
dfad1d5eec
Added event callback to sensors
6 years ago
Xose Pérez
170f0d543c
Option to publish address via MQTT for any sensor
6 years ago
Xose Pérez
c38911beae
Fix reference to sensor slot method
6 years ago
Xose Pérez
af805ab045
Update copyright notices
6 years ago
Xose Pérez
e1baf48b9b
Option to disable completely new sensors module
7 years ago
Xose Pérez
f3c7ae2671
Move magnitude topics, decimals and units to PROGMEM
7 years ago
Xose Pérez
3036676958
Check used GPIOs via locks
7 years ago
Xose Pérez
2bc8794919
Move I2C code in BaseSensor to I2CSensor
7 years ago
Xose Pérez
1fd269e05e
Moving interrupt handling routines from Abstract classes (ICACHE_RAM_ATTR and virtual do not get on well)
7 years ago
Xose Pérez
28d59083ac
Fix early access bug to HLW8012 instance on HLW8012Sensor
7 years ago
Xose Pérez
144e9cae40
Add support for sensor interrupts on GPIO1 and 3
7 years ago
Xose Pérez
1ac4a61206
Migrate HLW8012 sensor to new sensor module, remove old code
7 years ago
Xose Pérez
956215eac5
Default slot method in BaseSensor class
7 years ago
Xose Pérez
6e839e3d72
Added sensor IDs
7 years ago
Xose Pérez
c975b11226
Tentative to sensor manifest
7 years ago
Xose Pérez
4e454331d4
Improved I2C auto-discover avoiding collissions
7 years ago
Xose Pérez
7a2b4a7847
Normal debug for sensors
7 years ago
Xose Pérez
42f5ee5376
Flag sensor changes to avoid reinitializing them if unnecessary
7 years ago
Xose Pérez
90a7f7f6d2
Interrupt handling routines for sensors
7 years ago
Xose Pérez
8728d55b7b
Change sensor API, force parameter-less constructors
7 years ago
Xose Pérez
ef04f72228
Headers for Sensor and Filter classes
7 years ago
Xose Pérez
7cc06d9892
Homogeneize sensor error codes
7 years ago
Xose Pérez
86df1c892c
Adapt BME280 code for BMP280 sensor
7 years ago
Xose Pérez
77b05086d9
Added support for MHZ19 CO2 sensor
7 years ago
Xose Pérez
cb3297183d
Simple digital sensor
7 years ago
Xose Pérez
1fd5cbe5fd
Playing with the sensor interrupt routines
7 years ago
Oscar Rovira
bf486a3b84
Add long warm up option for sensors (non-blocking), re-organize code, and non-blocking read of PMS
7 years ago
Oscar Rovira
610f161be7
Begin with PMSx003 support
7 years ago
Xose Pérez
fa74776327
Improve hierarchi for EmonSensor
7 years ago
Xose Pérez
3ade0ae035
Added analog energy monitor sensor to new sensors module
7 years ago
Xose Pérez
ebe0d5e410
Fixed DallasSensor
7 years ago
Xose Pérez
b2dd7e5b56
Migrate DS18B20 and counter to new sensor module
7 years ago
Xose Pérez
f6378d52e4
Some name refactoring
7 years ago
Xose Pérez
2299ce9bfd
Basic sensor scafolding, DHT 90% migrated
7 years ago