arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.18k stars 4.8k forks source link

Activating dummy energy monitoring? #12970

Closed AndreKR closed 3 years ago

AndreKR commented 3 years ago

PROBLEM DESCRIPTION

I have two Shelly 1 devices, both with Tasmota 9.5.0, but one is compiled with USE_ADC_VCC and uses this template:

{"NAME":"Shelly 1","GPIO":[0,0,0,0,224,192,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":46}

and the other one is compiled without USE_ADC_VCC and uses this template:

{"NAME":"Shelly 1","GPIO":[0,0,0,0,224,192,0,0,0,0,0,0,0,4704],"FLAG":0,"BASE":46}

The one without USE_ADC_VCC shows the ADC input, as expected:

image

But the other one shows energy measurements, which of course are all 0 because the Shelly 1 does not have energy monitoring nor is it enabled:

image

It is also discovered as an energy monitoring device in Home Assistant.

I think the only difference between the two devices is the value of USE_ADC_VCC.

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

- [X] Provide the output of this command: `Status 0`:
```lua
23:59:34.110 MQT: stat/tasmota_D80FCE/STATUS0 = {"Status":{"Module":0,"DeviceName":"Amplifier","FriendlyName":["Amplifier"],"Topic":"tasmota_D80FCE","ButtonTopic":"0","Power":1,"PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0},"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota/release/tasmota.bin.gz","RestartReason":"Software/System restart","Uptime":"0T00:12:19","StartupUTC":"2021-08-24T22:47:15","Sleep":50,"CfgHolder":4617,"BootCount":15,"BCResetTime":"2021-08-24T03:40:06","SaveCount":30,"SaveAddress":"F9000"},"StatusFWR":{"Version":"9.5.0(TasmoCompiler-esp8266generic)","BuildDateTime":"2021-08-22T01:09:54","Boot":31,"Core":"2_7_4_9","SDK":"2.2.2-dev(38a443e)","CpuFrequency":80,"Hardware":"ESP8266EX","CR":"389/699"},"StatusLOG":{"SerialLog":2,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["",""],"TelePeriod":300,"Resolution":"558180C0","SetOption":["00008009","2805C8000100060000005A0A000000000000","00000080","00006000","00000000"]},"StatusMEM":{"ProgramSize":590,"Free":412,"Heap":26,"ProgramFlashSize":1024,"FlashSize":2048,"FlashChipId":"15701C","FlashFrequency":40,"FlashMode":3,"Features":["00000809","8FC04587","04268001","1400000F","410013C0","C800EDC1","08244004","00001000","00000020"],"Drivers":"1,2,3,4,6,8,9,10,12,16,18,19,22,24,26,27,29,30,35,37,45","Sensors":"1,3"},"StatusNET":{"Hostname":"tasmota_D80FCE-4046","IPAddress":"192.168.42.117","Gateway":"192.168.42.1","Subnetmask":"255.255.255.0","DNSServer":"192.168.42.1","Mac":"E8:DB:84:D8:0F:CE","Webserver":2,"WifiConfig":4,"WifiPower":17.0},"StatusMQT":{"MqttHost":"192.168.42.5","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_D80FCE","MqttUser":"tasmota","MqttCount":1,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":4},"StatusTIM":{"UTC":"2021-08-24T22:59:34","Local":"2021-08-24T23:59:34","StartDST":"2021-03-28T02:00:00","EndDST":"2021-10-31T03:00:00","Timezone":"+01:00","Sunrise":"05:56","Sunset":"19:48"},"StatusPTH":{"PowerDelta":[0,0,0],"PowerLow":0,"PowerHigh":0,"VoltageLow":0,"VoltageHigh":0,"CurrentLow":0,"CurrentHigh":0},"StatusSNS":{"Time":"2021-08-24T23:59:34","Switch1":"OFF","ENERGY":{"TotalStartTime":"2021-08-24T03:40:06","Total":0.000,"Yesterday":0.000,"Today":0.000,"Power":0,"Current":0.000},"TIC":{}},"StatusSTS":{"Time":"2021-08-24T23:59:34","Uptime":"0T00:12:19","UptimeSec":739,"Vcc":3.499,"Heap":25,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":27,"MqttCount":1,"POWER":"ON","Wifi":[redacted]}}


### TO REPRODUCE
Compile Tasmota with `USE_ADC_VCC` and apply the Shelly 1 template. I don't know if it is necessary to do this on an actual Shelly 1 device ( I don't know what triggers the energy monitoring functionality to activate).

### EXPECTED BEHAVIOUR
The device home page only shows the Device type, its name, the on/off state and the buttons. No energy monitoring output.

### SCREENSHOTS
See above.

### ADDITIONAL CONTEXT
\-
AndreKR commented 3 years ago

It turns out USE_ADC_VCC is not the culprit.

I have just flashed the affected device with a firmware that doesn't have USE_ADC_VCC enabled and now the analog input is shown as expected, but the bogus energy monitoring is still shown:

image

image

Not sure what is going on.

ascillato commented 3 years ago

Please, do a reset 6 on that device.

AndreKR commented 3 years ago

Done, this is the result:

image

ascillato commented 3 years ago

Please, try to update that device to latest Tasmota of the development branch:

In the console type:

OTAurl http://ota.tasmota.com/tasmota/tasmota.bin.gz
Upgrade 1

Then do a reset 6 again please

ascillato commented 3 years ago

Also, after all that, please, set weblog to 4 and then restart the device. Please, copy the content of the console. Thanks.

AndreKR commented 3 years ago

The problem doesn't happen with the official development image. It does not happen with the official release image (9.5.0) either.

It only happens with my image from TasmoCompiler. Here's my user_config_override.h:

user_config_override.h ```c #ifndef _USER_CONFIG_OVERRIDE_H_ #define _USER_CONFIG_OVERRIDE_H_ #ifdef CODE_IMAGE_STR #undef CODE_IMAGE_STR #endif #define CODE_IMAGE_STR "TasmoCompiler-esp8266generic" #ifdef USE_MHZ19 #undef USE_MHZ19 #endif #ifdef USE_SENSEAIR #undef USE_SENSEAIR #endif #ifdef USE_PMS5003 #undef USE_PMS5003 #endif #ifdef USE_MGS #undef USE_MGS #endif #ifdef USE_NOVA_SDS #undef USE_NOVA_SDS #endif #ifdef USE_SGP30 #undef USE_SGP30 #endif #ifdef USE_CCS811 #undef USE_CCS811 #endif #ifdef USE_SCD30 #undef USE_SCD30 #endif #ifdef USE_SPS30 #undef USE_SPS30 #endif #ifdef USE_HPMA #undef USE_HPMA #endif #ifdef USE_IAQ #undef USE_IAQ #endif #ifdef USE_EMULATION #undef USE_EMULATION #endif #ifdef USE_EMULATION_HUE #undef USE_EMULATION_HUE #endif #ifdef USE_EMULATION_WEMO #undef USE_EMULATION_WEMO #endif #ifdef USE_TASMOTA_CLIENT #undef USE_TASMOTA_CLIENT #endif #ifdef USE_DISPLAY #undef USE_DISPLAY #endif #ifdef USE_DISPLAY_MODES1TO5 #undef USE_DISPLAY_MODES1TO5 #endif #ifdef USE_DISPLAY_LCD #undef USE_DISPLAY_LCD #endif #ifdef USE_DISPLAY_SSD1306 #undef USE_DISPLAY_SSD1306 #endif #ifdef USE_DISPLAY_MATRIX #undef USE_DISPLAY_MATRIX #endif #ifdef USE_DISPLAY_ILI9341 #undef USE_DISPLAY_ILI9341 #endif #ifdef USE_DISPLAY_EPAPER_29 #undef USE_DISPLAY_EPAPER_29 #endif #ifdef USE_DISPLAY_EPAPER_42 #undef USE_DISPLAY_EPAPER_42 #endif #ifdef USE_DISPLAY_SH1106 #undef USE_DISPLAY_SH1106 #endif #ifdef USE_DISPLAY_ILI9488 #undef USE_DISPLAY_ILI9488 #endif #ifdef USE_DISPLAY_SSD1351 #undef USE_DISPLAY_SSD1351 #endif #ifdef USE_DISPLAY_RA8876 #undef USE_DISPLAY_RA8876 #endif #ifdef USE_DISPLAY_SEVENSEG #undef USE_DISPLAY_SEVENSEG #endif #ifdef USE_DISPLAY_ST7789 #undef USE_DISPLAY_ST7789 #endif #ifdef USE_DISPLAY_SSD1331 #undef USE_DISPLAY_SSD1331 #endif #ifdef USE_ADC_VCC #undef USE_ADC_VCC #endif #ifdef USE_DOMOTICZ #undef USE_DOMOTICZ #endif #ifdef USE_ENERGY_SENSOR #undef USE_ENERGY_SENSOR #endif #define USE_ENERGY_SENSOR #ifdef USE_HLW8012 #undef USE_HLW8012 #endif #define USE_HLW8012 #ifdef USE_CSE7766 #undef USE_CSE7766 #endif #define USE_CSE7766 #ifdef USE_PZEM004T #undef USE_PZEM004T #endif #define USE_PZEM004T #ifdef USE_MCP39F501 #undef USE_MCP39F501 #endif #define USE_MCP39F501 #ifdef USE_PZEM_AC #undef USE_PZEM_AC #endif #define USE_PZEM_AC #ifdef USE_PZEM_DC #undef USE_PZEM_DC #endif #define USE_PZEM_DC #ifdef USE_ADE7953 #undef USE_ADE7953 #endif #define USE_ADE7953 #ifdef USE_SDM120 #undef USE_SDM120 #endif #define USE_SDM120 #ifdef USE_DDS2382 #undef USE_DDS2382 #endif #define USE_DDS2382 #ifdef USE_SDM630 #undef USE_SDM630 #endif #define USE_SDM630 #ifdef USE_DDSU666 #undef USE_DDSU666 #endif #define USE_DDSU666 #ifdef USE_SOLAX_X1 #undef USE_SOLAX_X1 #endif #define USE_SOLAX_X1 #ifdef USE_LE01MR #undef USE_LE01MR #endif #define USE_LE01MR #ifdef USE_BL0940 #undef USE_BL0940 #endif #define USE_BL0940 #ifdef USE_TELEINFO #undef USE_TELEINFO #endif #define USE_TELEINFO #ifdef USE_IEM3000 #undef USE_IEM3000 #endif #define USE_IEM3000 #ifdef USE_WE517 #undef USE_WE517 #endif #define USE_WE517 #ifdef USE_ENERGY_DUMMY #undef USE_ENERGY_DUMMY #endif #define USE_ENERGY_DUMMY #ifdef USE_SONOFF_SC #undef USE_SONOFF_SC #endif #ifdef USE_DS18x20 #undef USE_DS18x20 #endif #ifdef USE_DHT #undef USE_DHT #endif #ifdef USE_SHT #undef USE_SHT #endif #ifdef USE_HTU #undef USE_HTU #endif #ifdef USE_BMP #undef USE_BMP #endif #ifdef USE_SHT3X #undef USE_SHT3X #endif #ifdef USE_LM75AD #undef USE_LM75AD #endif #ifdef USE_APDS9960 #undef USE_APDS9960 #endif #ifdef USE_AZ7798 #undef USE_AZ7798 #endif #ifdef USE_MAX31855 #undef USE_MAX31855 #endif #ifdef USE_MLX90614 #undef USE_MLX90614 #endif #ifdef USE_MAX31865 #undef USE_MAX31865 #endif #ifdef USE_HIH6 #undef USE_HIH6 #endif #ifdef USE_DHT12 #undef USE_DHT12 #endif #ifdef USE_DS1624 #undef USE_DS1624 #endif #ifdef USE_AHT1x #undef USE_AHT1x #endif #ifdef USE_HDC1080 #undef USE_HDC1080 #endif #ifdef USE_MCP9808 #undef USE_MCP9808 #endif #ifdef USE_HP303B #undef USE_HP303B #endif #ifdef USE_LMT01 #undef USE_LMT01 #endif #ifdef USE_BH1750 #undef USE_BH1750 #endif #ifdef USE_VEML6070 #undef USE_VEML6070 #endif #ifdef USE_TSL2561 #undef USE_TSL2561 #endif #ifdef USE_SI1145 #undef USE_SI1145 #endif #ifdef USE_VEML6075 #undef USE_VEML6075 #endif #ifdef USE_MAX44009 #undef USE_MAX44009 #endif #ifdef USE_TSL2591 #undef USE_TSL2591 #endif #ifdef USE_AS3935 #undef USE_AS3935 #endif #ifdef USE_VEML7700 #undef USE_VEML7700 #endif #ifdef USE_HOME_ASSISTANT #undef USE_HOME_ASSISTANT #endif #define USE_HOME_ASSISTANT #ifdef USE_MCP230xx #undef USE_MCP230xx #endif #ifdef USE_MCP230xx_OUTPUT #undef USE_MCP230xx_OUTPUT #endif #ifdef USE_MCP230xx_DISPLAYOUTPUT #undef USE_MCP230xx_DISPLAYOUTPUT #endif #ifdef USE_KNX #undef USE_KNX #endif #ifdef USE_IR_REMOTE #undef USE_IR_REMOTE #endif #ifdef USE_IR_REMOTE_FULL #undef USE_IR_REMOTE_FULL #endif #ifdef USE_DISCOVERY #undef USE_DISCOVERY #endif #ifdef USE_MQTT_TLS #undef USE_MQTT_TLS #endif #ifdef USE_RC_SWITCH #undef USE_RC_SWITCH #endif #ifdef USE_RULES #undef USE_RULES #endif #define USE_RULES #ifdef USE_EXPRESSION #undef USE_EXPRESSION #endif #define USE_EXPRESSION #ifdef SUPPORT_IF_STATEMENT #undef SUPPORT_IF_STATEMENT #endif #define SUPPORT_IF_STATEMENT #ifdef USE_SCRIPT #undef USE_SCRIPT #endif #ifdef USE_TIMERS #undef USE_TIMERS #endif #define USE_TIMERS #ifdef USE_TUYA_MCU #undef USE_TUYA_MCU #endif #define USE_TUYA_MCU #ifdef USE_SR04 #undef USE_SR04 #endif #ifdef USE_VL53L0X #undef USE_VL53L0X #endif #ifdef USE_HRXL #undef USE_HRXL #endif #ifdef USE_DYP #undef USE_DYP #endif #ifdef USE_VL53L1X #undef USE_VL53L1X #endif #ifdef USE_WEBSERVER #undef USE_WEBSERVER #endif #define USE_WEBSERVER #ifdef USE_WS2812 #undef USE_WS2812 #endif #ifdef USE_UFILESYS #undef USE_UFILESYS #endif #ifdef USE_SDCARD #undef USE_SDCARD #endif #ifdef GUI_TRASH_FILE #undef GUI_TRASH_FILE #endif #ifdef GUI_EDIT_FILE #undef GUI_EDIT_FILE #endif #ifdef USE_I2C #undef USE_I2C #endif #define USE_I2C #ifdef USE_SPI #undef USE_SPI #endif #ifdef MY_LANGUAGE #undef MY_LANGUAGE #endif #define MY_LANGUAGE en_GB #endif ```
Console output ```text 00:00:00.001 HDW: ESP8266EX 00:00:00.050 CFG: Loaded from flash at F9, Count 23 00:00:00.055 QPC: Count 1 00:00:00.058 CFG: CR 374/699, Busy 0 00:00:00.060 CFG: CR 374/699, Busy 0 00:00:00.062 SRC: Restart 00:00:00.064 Project tasmota Amplifier Version 9.5.0(TasmoCompiler-esp8266generic)-2_7_4_9(2021-08-24T23:09:01) 00:00:00.065 TIC: RX on GPIO255, baudrate 1200 00:00:00.067 TIC: always enabled 00:00:00.221 WIF: Checking connection... 00:00:00.221 WIF: Attempting connection... 00:00:00.558 WIF: Connecting to AP1 [redacted] in mode 11n as tasmota_D80FCE-4046... 00:00:01.753 WIF: Checking connection... 00:00:01.753 WIF: Attempting connection... 00:00:02.754 WIF: Checking connection... 00:00:02.755 WIF: Attempting connection... 00:00:03.757 WIF: Checking connection... 00:00:03.758 WIF: Connected 00:00:04.007 HTP: Web server active on tasmota_D80FCE-4046 with IP address 192.168.42.117 00:00:04.460 RTC: UTC 2021-08-25T01:39:42, DST 2021-03-28T02:00:00, STD 2021-10-31T03:00:00 02:39:43.013 MQT: Attempting connection... 02:39:43.225 MQT: Connect failed to 192.168.42.5:1883, rc -2. Retry in 10 sec 02:39:44.445 QPC: Reset 02:39:45.421 NRG: Energy reset by invalid data 02:39:46.421 APP: Boot Count 7 02:39:46.563 CFG: Saved to flash at F8, Count 24, Bytes 4096 02:39:54.017 MQT: Attempting connection... 02:39:54.046 MQT: Connected 02:39:54.049 MQT: tele/tasmota_D80FCE/LWT = Online (retained) 02:39:54.051 MQT: cmnd/tasmota_D80FCE/POWER = 02:39:54.053 MQT: Subscribe to cmnd/tasmota_D80FCE/# 02:39:54.054 MQT: Subscribe to cmnd/tasmotas/# 02:39:54.057 MQT: Subscribe to cmnd/DVES_D80FCE_fb/# 02:39:54.059 MQT: Unsubscribe from homeassistant/status 02:39:54.064 MQT: tele/tasmota_D80FCE/INFO1 = {"Info1":{"Module":"Shelly 1","Version":"9.5.0(TasmoCompiler-esp8266generic)","FallbackTopic":"cmnd/DVES_D80FCE_fb/","GroupTopic":"cmnd/tasmotas/"}} 02:39:54.075 MQT: tele/tasmota_D80FCE/INFO2 = {"Info2":{"WebServerMode":"Admin","Hostname":"tasmota_D80FCE-4046","IPAddress":"192.168.42.117"}} 02:39:54.089 MQT: tele/tasmota_D80FCE/INFO3 = {"Info3":{"RestartReason":"Software/System restart"}} 02:39:54.096 MQT: stat/tasmota_D80FCE/RESULT = {"POWER":"ON"} 02:39:54.100 MQT: stat/tasmota_D80FCE/POWER = ON 02:39:55.376 SRC: MQTT 02:39:55.378 CMD: Grp 0, Cmnd 'STATE', Idx 1, Len 0, Data '' 02:39:55.385 MQT: stat/tasmota_D80FCE/RESULT = {"Time":"2021-08-25T02:39:55","Uptime":"0T00:00:19","UptimeSec":19,"Heap":29,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":33,"MqttCount":1,"POWER":"ON","Wifi":[redacted]} 02:39:55.451 SRC: MQTT 02:39:55.453 CMD: Grp 0, Cmnd 'STATUS', Idx 1, Len 2, Data '10' 02:39:55.498 MQT: stat/tasmota_D80FCE/STATUS10 = {"StatusSNS":{"Time":"2021-08-25T02:39:55","Switch1":"OFF","ANALOG":{"A0":45},"ENERGY":{"TotalStartTime":"2021-08-25T01:27:43","Total":0.000,"Yesterday":0.000,"Today":0.000,"Power":0,"Current":0.000},"TIC":{}}} 02:39:58.381 MQT: tele/tasmota_D80FCE/STATE = {"Time":"2021-08-25T02:39:58","Uptime":"0T00:00:22","UptimeSec":22,"Heap":29,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":52,"MqttCount":1,"POWER":"ON","Wifi":[redacted]} 02:39:58.445 MQT: tele/tasmota_D80FCE/SENSOR = {"Time":"2021-08-25T02:39:58","Switch1":"OFF","ANALOG":{"A0":47},"ENERGY":{"TotalStartTime":"2021-08-25T01:27:43","Total":0.000,"Yesterday":0.000,"Today":0.000,"Period":0,"Power":0,"Current":0.000},"TIC":{}} 02:40:01.781 WIF: Checking connection... 02:40:03.391 MQT: tasmota/discovery/E8DB84D80FCE/config = {"ip":"192.168.42.117","dn":"Amplifier","fn":["Amplifier",null,null,null,null,null,null,null],"hn":"tasmota_D80FCE-4046","mac":"E8DB84D80FCE","md":"Shelly 1","ty":0,"if":0,"ofln":"Offline","onln":"Online","state":["OFF","ON","TOGGLE","HOLD"],"sw":"9.5.0","t":"tasmota_D80FCE","ft":"%prefix%/%topic%/","tp":["cmnd","stat","tele"],"rl":[1,0,0,0,0,0,0,0],"swc":[-1,-1,-1,-1,-1,-1,-1,-1],"swn":[null,null,null,null,null,null,null,null],"btn":[0,0,0,0,0,0,0,0],"so":{"4":0,"11":0,"13":0,"17":0,"20":0,"30":0,"68":0,"73":0,"82":0,"114":0,"117":0},"lk":1,"lt_st":0,"sho":[0,0,0,0],"ver":1} (retained) 02:40:03.442 MQT: tasmota/discovery/E8DB84D80FCE/sensors = {"sn":{"Time":"2021-08-25T02:40:03","Switch1":"OFF","ANALOG":{"A0":42},"ENERGY":{"TotalStartTime":"2021-08-25T01:27:43","Total":0.000,"Yesterday":0.000,"Today":0.000,"Power":0,"Current":0.000},"TIC":{}},"ver":1} (retained) 02:40:22.036 WIF: Checking connection... 02:40:42.298 WIF: Checking connection... 02:41:02.274 WIF: Checking connection... ```
ascillato commented 3 years ago

Ok

In your custom build you are enabling:

define USE_ENERGY_DUMMY

So that is why you have that.

Don't define that and you won't get the dummy energy consumption.

ascillato2 commented 3 years ago

Closing this issue as it has been answered.


Support Information

See Docs for more information. See Chat for more user experience. See Code of Conduct

AndreKR commented 3 years ago

I don't think I have control over that in TasmoCompiler, I have opened https://github.com/benzino77/tasmocompiler/issues/219.

ascillato commented 3 years ago

I have tested on Tasmocompiler with selecting use_vcc and without selecting energy_monitoring and the resulting firmware is ok. It doesn't have energy dummy sensor.

For this device, you should compile without adding energy monitoring due to your device don't have that and you don't want that either.

ascillato commented 3 years ago

When selecting ENERGY MEASUREMENTS, Tasmocompiler adds also ENERGY DUMMY SENSOR. This is expected and correct. If you don't need and you don't want energy measurements (neither with a power measurement chip or by a dummy sensor) you should not select energy measurements in Tasmocompiler.

Energy Dummy will count power consumption using a fixed voltage value + a fixed current value and the time the relay is ON. Those values are configured in the same way as the calibration of the power measurement chip (please, see the docs for that).

So, this is neither a Tasmota bug nor a Tasmocompiler bug. Just disable what you don't need. Thanks.

AndreKR commented 3 years ago

I see. My intention was to have a firmware that can do everything I need, but it will only actually do it when it is configured to do so.

ascillato commented 3 years ago

In that case, In Tasmocompiler select ENERGY MONITORING and then add the following in the CUSTOM PARAMETER section:

undef USE_ENERGY_DUMMY