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
21.98k stars 4.77k forks source link

Support for SONOFF Smart Power Meter Switch | POW Elite #15856

Closed nobodyman1 closed 2 years ago

nobodyman1 commented 2 years ago

PROBLEM DESCRIPTION

Is it possible to use Tasmota on the new SONOFF POW Elite? I found some Pictures here. It´s based on an ESP32 and the power measuring is done with a CSE7759B (same as used in SONOFF POW R2). But what´s about the LCD driver?

REQUESTED INFORMATION

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

EXPECTED BEHAVIOUR

A clear and concise description of what you expected to happen.

SCREENSHOTS

If applicable, add screenshots to help explain your problem.

ADDITIONAL CONTEXT

Add any other context about the problem here.

(Please, remember to close the issue when the problem has been addressed)

barbudor commented 1 year ago

Not surprised if it is a THR THR and POW are 2 different products Which one do you have?

ag3nt-sn4k3 commented 1 year ago

Sadly, I must have ordered the wrong product. I have the THR320D. Should not it still show something on the display?

barbudor commented 1 year ago

If you have plugged the external T&H sensor and configured GPIO 25 to it, you could have temp and Hum displayed. Not sure the sensor is sold with by default or if it is an option

ag3nt-sn4k3 commented 1 year ago

Thank you for your reply. I have just ordered the right product then I think everything will work.

sfromis commented 1 year ago

The THR320D has two relays, hence two buttons. The second relay is a dry lower voltage relay, able to make/break connections in the port beside the socket for the sensor probe.

ag3nt-sn4k3 commented 1 year ago

Thank you for the explanation. I currently do not know why I would need that. I hope Monday arrives my POWR320D so I can replace my broken POW r2.

sfromis commented 1 year ago

It is a potentially useful feature, for things like controlling devices by other means than power on/off, but of course many users are not doing that. You could even remove Relay 2 from the config, if you prefer, and still use the device for other purposes.

jacoherotel commented 1 year ago

I hope someone has run into this problem before. I ordered a new POW Elite last week. upon receiving, I flashed esp32 with pre compiled binary, which went smooth. (I have more than 50 Tasmota devices running in my home :-) - Thanks btw all !) After the flash it went into a boot loop. My first thought was that it might be power related (not enough). However even when on AC the problem persisted. I returned the unit, received a new one, and same result. I tried different builds, and also tried flashing from compiled PlatformIO build, no success. So the flash works but the bootloop persists.

So just to be clear I did use the latest dev build, I also tried the safeboot version. One more thing I tried was uploading a simple sketch from Arduino IDE, and it also goes into a boot loop. So obviously its not Tasmota related. Just hoping someone can steer me in the right direction.

`00:00:00.002 HDW: ESP32-D0WD-V3 00:00:00.042 CFG: Loaded from NVS, Count 2 00:00:00.048 Project tasmota - Tasmota Version 12.2.0.4(safeboot)-2_0_5_3(2022-11-10T19:12:22) 00:00:00.049 WARNING This version does not support persistent settings 00:00:00.261 WIF: WifiManager active for 3 minutes ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:184 load:0x40078000,len:12588 ho 0 tail 12 room 4 load:0x40080400,len:2916 entry 0x400805c4`

Anyone have any idea what this stack error might mean ?

Thanks again !

sfromis commented 1 year ago

It does not make sense to "try" the safeboot binary, it is only useful as a "stepping stone" binary automatically used during firmware upgrade. You do not show anything about some "stack error", or exactly (step by step) what you did when flashing.

Anyway, Tasmota will "boot loop" every 3 minutes while waiting for connection to t he onboarding AP, this is normal.

jacoherotel commented 1 year ago

@sfromis Thank you for the quick reply, Ok thanks for clearing up the safeboot binary, I thought it was something I could try should a normal boot fails. Thanks yes I am aware of the restart after 3 minutes, however that's not happening in this case. So to answer the question regarding the steps, I cloned the latest dev branch to my local pc. I then selected tasmota32 under project tasks. I then did a upload and monitor. To upload the firmware I started the unit with the button (gpio0) pushed. The flash runs successfully with no errors. Apologies for not including a better output log. As you can see on the one below the bootloop is starting immediately after the wifi manager starts.

`Writing at 0x0020fe12... (84 %) Writing at 0x00215b26... (85 %) Writing at 0x0021b529... (87 %) Writing at 0x00220722... (89 %) Writing at 0x002265e4... (90 %) Writing at 0x0022b7ee... (92 %) Writing at 0x00232c4f... (93 %) Writing at 0x00238287... (95 %) Writing at 0x0023d97f... (96 %) Writing at 0x00242ed6... (98 %) Writing at 0x00248e52... (100 %) Wrote 1480128 bytes (1033461 compressed) at 0x000e0000 in 25.8 seconds (effective 458.9 kbit/s)... Hash of data verified.

Leaving... Hard resetting via RTS pin... =========================================================================== [SUCCESS] Took 177.10 seconds ===========================================================================--- Terminal on COM4 | 115200 8-N-1 --- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time --- More details at https://bit.ly/pio-monitor-filters --- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:184 load:0x40078000,len:12588 ho 0 tail 12 room 4 load:0x40080400,len:2916 entry 0x400805c4

00:00:00.002 HDW: ESP32-D0WD-V3 00:00:00.067 UFS: FlashFS mounted with 308 kB free 00:00:00.134 CFG: Loaded from File, Count 2 00:00:00.149 QPC: Count 6 00:00:00.644 BRY: Berry initialized, RAM used=4711 bytes 00:00:00.675 Project tasmota - Tasmota Version 12.2.0.4(tasmota)-2_0_5_3(2022-11-10T20:16:59) 00:00:00.028 WIF: WifiManager active for 3 minutes ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:184 load:0x40078000,len:12588 ho 0 tail 12 room 4 load:0x40080400,len:2916 entry 0x400805c4

00:00:00.002 HDW: ESP32-D0WD-V3 00:00:00.067 UFS: FlashFS mounted with 308 kB free 00:00:00.134 CFG: Loaded from File, Count 2 ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:184 load:0x40078000,len:12588 ho 0 tail 12 room 4 load:0x40080400,len:2916 entry 0x400805c4

00:00:00.002 HDW: ESP32-D0WD-V3 00:00:00.073 UFS: FlashFS mounted with 312 kB free 00:00:00.083 CFG: Loaded from NVS, Count 2 00:00:00.087 FRC: Some settings have been reset (2) 00:00:00.563 BRY: Berry initialized, RAM used=4711 bytes 00:00:00.594 Project tasmota - Tasmota Version 12.2.0.4(tasmota)-2_0_5_3(2022-11-10T20:16:59) 00:00:00.919 WIF: WifiManager active for 3 minutes ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:184 load:0x40078000,len:12588 ho 0 tail 12 room 4 load:0x40080400,len:2916 entry 0x400805c4

00:00:00.003 HDW: ESP32-D0WD-V3 00:00:00.074 UFS: FlashFS mounted with 312 kB free 00:00:00.093 CFG: Use defaults 00:00:00.344 QPC: Reset 00:00:00.842 BRY: Berry initialized, RAM used=4711 bytes 00:00:00.881 Project tasmota - Tasmota Version 12.2.0.4(tasmota)-2_0_5_3(2022-11-10T20:16:59) 00:00:01.549 WIF: WifiManager active for 3 minutes ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:184 load:0x40078000,len:12588 ho 0 tail 12 room 4 load:0x40080400,len:2916 entry 0x400805c4

00:00:00.003 HDW: ESP32-D0WD-V3 00:00:00.010 UFS: FlashFS mounted with 308 kB free 00:00:00.025 CFG: Loaded from File, Count 2 00:00:00.040 QPC: Count 1 00:00:00.449 BRY: Berry initialized, RAM used=4711 bytes 00:00:00.467 Project tasmota - Tasmota Version 12.2.0.4(tasmota)-2_0_5_3(2022-11-10T20:16:59) 00:00:00.775 WIF: WifiManager active for 3 minutes ets Jul 29 2019 12:21:46`

jacoherotel commented 1 year ago

Thanks so much for your help. I tried powering the unit again from AC, and now it booted up. ! Sorry for the false alarm ! All is good now. Thanks again.

LUBANG37 commented 1 year ago

I have a POWR320D (tasmota). I would like the display to show only watt and volt. It is possible ?

arendst commented 1 year ago

No as the lcd can only show V/A or W/kWh at one time.

netfritz22 commented 1 year ago

Hallo Habe meinen SonOff THR320 mit der Neusten Tasmota Firmware geflasht. Dieses Template habe ich eingegeben: {"NAME":"Sonoff THR320D","GPIO":[32,0,0,0,226,9280,0,0,0,321,0,576,320,9184,9216,9312,0,0,9313,9248,0,1,0,3840,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1} Auf dem Display bekomme ich nur Temp. Feuchte und Taupunkt angezeigt. Habe einen Heitzlüfter 1000W angeschlossen, es wird wird keine Leistung ( KW , KWh Volt ) angezeigt. Was kann ich machen? THR320D_Info

arendst commented 1 year ago

Buy a POWR320 to measure energy. The THR320 has no hardware to measure energy.

netfritz22 commented 1 year ago

Entschuldiung, da muss ich was verwechelt haben. Danke

Rincovanderbeek commented 1 year ago

@ Arendst; I use the POWR316D with the given config, all works fine. However, I removed the relais and shortcut the contacts and want to measure continuesly. The problem is that mearuring only works when the software switch is toggled on; I ned it to measure always. Is there any way to put measuring always on ?

jacoherotel commented 1 year ago

How about a rule on startup to toggle power1 to on ?

Rincovanderbeek commented 1 year ago

The thing is that is is for my dishwasher; The dishwasher needs a short press to toggle on. So I use the relaiscontact parallel to the startbutton of the dishwasher and have it on for 1 second and then off. But when off, the measuring stops and I want it to continue.

arendst commented 1 year ago

Did you try with SO21 1?

Rincovanderbeek commented 1 year ago

No, how to use that? via console or in the template?

Rincovanderbeek commented 1 year ago

Sorry, not awake :-(
Got it and it works. Thanks!

Janno-A commented 1 year ago

Did you try with SO21 1?

I have the same wish, to enable the monitoring even when the relay is switched off. Once I activate the So21 1, then I will get the readings on the low voltage (14.3V), and 0 Amps (no devices connected to output) when the relay is off, and normal voltage when the relay is ON. When I connect the incandescent light bulb (100W) to the output, then the voltage reading shows 0.4V instead (while the relay is off). I am using 12.2.0 fw. POWR320D. (PS Similar low-voltage reading has been mentioned here also earlier (by [muebau], in August 03), while my device does not report any other voltages while the relay is off.)

Bonerserk commented 1 year ago

Hi, I have the 20A model POWR320D. I want to use the maxpower functionality and it works but the max value accepted is 3600. Is it possible to extend the value to more than 3600 to use the 20A power?

arendst commented 1 year ago

Thx. @Bonerserk I'll fix it in due time

UPDATE: Implemented in latest dev release just now. Pre-compiled available in an hour at http://ota.tasmota.com/tasmota32

Rincovanderbeek commented 1 year ago

Hi, I do not have that problem, maybe because I removed the relais from the PCB and soldered a bridge between the L and the L1. As I have the classic version, I cannot checkif there is a difference between web and display.

Met vriendelijke groet,

Rinco van der Beek


Van: Janno-A @.> Verzonden: Sunday, December 4, 2022 12:43:55 AM Aan: arendst/Tasmota @.> CC: Rincovanderbeek @.>; Comment @.> Onderwerp: Re: [arendst/Tasmota] Support for SONOFF Smart Power Meter Switch | POW Elite (Issue #15856)

Did you try with SO21 1?

I have the same wish, to enable the monitoring even when the relay is switched off. Once I activate the So21 1, then I will get the readings on the low voltage (14.3V), and 0 Amps (no devices connected to output) when the relay is off, and normal voltage when the relay is ON. When I connect the incandescent light bulb (100W) to the output, then the voltage reading shows 0.4V instead (while the relay is off). I am using 12.2.0 fw. POWR320D. (PS Similar low-voltage reading has been mentioned here also earlier (by [muebau], in August 03), while my device does not report any other voltages while the relay is off.)

— Reply to this email directly, view it on GitHubhttps://github.com/arendst/Tasmota/issues/15856#issuecomment-1336279638, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASLG3SI7EHLWO5L47VKJANDWLPLLXANCNFSM5ZVP735A. You are receiving this because you commented.Message ID: @.***>

arendst commented 1 year ago

@Janno-A as you noticed the POWRxxD monitors energy behind the relay. So if the relay is OFF it cannot meassure voltage and current (and hence power). The voltage level you see is noise meassured.

I see no difference in GUI and LCD display; they report the same. Verify your GUI refresh rate (webrefresh, usually 2345 (milliseconds)) and LCD display update speed (DspSpeed, usually 3 (seconds)).

sfromis commented 1 year ago

This "noise" (which I also see) means that SetOption21 is useless for the device.

Rincovanderbeek commented 1 year ago

If you bridge the contacts of the relais on the PCB, setoption21 1 works perfectly well.

Met vriendelijke groet,

Rinco van der Beek


Van: sfromis @.> Verzonden: Sunday, December 4, 2022 4:48:23 PM Aan: arendst/Tasmota @.> CC: Rincovanderbeek @.>; Comment @.> Onderwerp: Re: [arendst/Tasmota] Support for SONOFF Smart Power Meter Switch | POW Elite (Issue #15856)

This "noise" (which I also see) means that SetOption21 is useless for the device.

— Reply to this email directly, view it on GitHubhttps://github.com/arendst/Tasmota/issues/15856#issuecomment-1336448490, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASLG3SMLHHZSOR2QO4TZJYLWLS4MPANCNFSM5ZVP735A. You are receiving this because you commented.Message ID: @.***>

jongdesteven commented 1 year ago

Not sure if you knew already, but i didn't see this before:

I want to use the 3rd pin on the connector for a 2nd sensor, but as stated it is NC. After some measurements, i found it is connected but missing some resistors: R25: 1K Pull-up to 3V3 (not mandatory imo) R16: Series 47R to GPIO33.

Unfortunately, really small (0201?) size SMD components i don't have on stock. are used.

Janno-A commented 1 year ago

@Janno-A as you noticed the POWRxxD monitors energy behind the relay. So if the relay is OFF it cannot meassure voltage and current (and hence power). The voltage level you see is noise meassured.

I see no difference in GUI and LCD display; they report the same. Verify your GUI refresh rate (webrefresh, usually 2345 (milliseconds)) and LCD display update speed (DspSpeed, usually 3 (seconds)).

I have checked the refresh speeds: GUI was the default (2345) and LCD was on 5 sec (I have adjusted it to 3).

I have made an experiment: I have connected the '100W' bulb to output. The web GUI says 98W. When I manually set the Powerset 105, then the LCD starts showing 105,x W, but the web GUI remain on 97..98W. When I lower it to the PowerSet 90, then the LCD starts showing the 90.xW, and the web GUI's Active power turns down to 90W, but the Apparent Power remains on 98W and the PF is adjusted to 0.93 (from 1.0) and Reactive power is introduced (34VAr). What could be the reason?

rambosheep commented 1 year ago

hi i have a thr320d flashed with (https://ota.tasmota.com/tasmota32/tasmota32.bin) every thing seems ok 'ish' i have the temp displayed on the display but id like to increase how often it updates both on the display and also how often it will update to ha using mqtt it seems to be every 5 minutes at the moment for mqtt updates display seems to be 10 seconds

i want to use this for boiler flow and return temps so more often would be good

sfromis commented 1 year ago

MQTT publishing frequency is TelePeriod, default 300 seconds, minimum 10 seconds.

rambosheep commented 1 year ago

MQTT publishing frequency is TelePeriod, default 300 seconds, minimum 10 seconds.

Cheer, I was sure id set that!

shame it cant poll more frequently though

sfromis commented 1 year ago

You can create Berry code to poll it more frequently, and publish the already formatted sensor payload at your discretion.

rambosheep commented 1 year ago

ooh something new to look at

any handy links ?

sfromis commented 1 year ago

Berry is a nice programming language available with Tasmota on ESP32, and with a fair amount of integration with Tasmota features. You have specific functions for things like polling sensors, handling JSON and MQTT, and setting up timers.

douggutaby commented 1 year ago

Hi

UPDATE: Sorry, it was user error. How tasmota should know there are leds and buttons if I didn't set the module? omg

I flashed sonoff pow origin with tasmota32.bin and it is not working. I don't understand why. This is my first esp32 device, I've used Tasmotizer until today, but for this I tried esptool.py and web installer as well.

I downloaded the tasmota32.bin, and read, erase, write: esptool.py -p /dev/tty.SLAB_USBtoUART read_flash 0x00000 0x400000 image4M.bin esptool.py -p /dev/tty.SLAB_USBtoUART erase_flash esptool.py -p /dev/tty.SLAB_USBtoUART write_flash -fs 4MB -fm dout 0x0 ../tasmota32.bin

no error, flash was success and... nothing. LEDs are dark, button is not working, but if I restore from backup esptool.py -p /dev/tty.SLAB_USBtoUART write_flash -fs 4MB -fm dout 0x0 image4M.bin leds and button are working

Can you help me?

sfromis commented 1 year ago

For initial wired flashing, you should use tasmota32.factory.bin, the tasmota32.bin image is for OTA, or for a more complex 4-file flashing. It is recommended to instead use the Tasmota Web Installer to have such details handled automatically, and not download first. Tasmotizer does not work for ESP32.

douggutaby commented 1 year ago

Yes, thanks it was working with factory.bin. At least, I met with esptool.py and used right :)

anixi commented 1 year ago

Hi All, I have the THR320 with Tasmota connected to a DS18x20. Switch works fine but no temperature. The [Sonoff_THR316D_with_DS18x20.autoconf] seems to be empty? Any ideas?

sfromis commented 1 year ago

As the .autoconf file is a binary file, you can't use a text-oriented tool like Tasmota "Manage File System" to see/edit it. The size should be near 300 bytes, which is non-empty. You can see the text file here: https://github.com/tasmota/autoconf/tree/main/raw/esp32/Sonoff_THR320D_with_DS18x20 Note: Better use this, instead of the one for THR316D, if your device is actually the THR320.

Do check the console for messages, with Weblog 3 for details.

anixi commented 1 year ago

Hi Sfromis, thanks for the quick feedback, Actually I have the THR316D but found the init.bat file, how do I use this file (hope not to stupid question? Outcome of is Weblog 3 is: 09:11:50.297 MQT: stat/tasmota_0FDEC8/RESULT = {"WebLog":3} 09:11:51.020 CFG: Saved, Count 111, Bytes 4096

sfromis commented 1 year ago

The outcome of Weblog 3 is not the direct response, but getting more details in the log after having set the option, like reporting about some error situations as they happen.

anixi commented 1 year ago

Ah thanks, so how do I use the init.bat file?

sfromis commented 1 year ago

I posted the link to show you what's inside the non-empty file. The file is used when you apply the autoconf setup. You could verify if the settings there are still in place.

anixi commented 1 year ago

I can see the template in the file, if I use that one I get two switches of which only one works as TH316D only has one relay. Hwat does Gpio25 1312, Module 0 means

arendst commented 1 year ago

The Sonoff THR316D has TWO relays hence the two switches. Gpio25 1312 sets GPIO to DS18x20 sensor. Module 0 activates the new template.

All you had to do is selecting Sonoff THR316D with DS18x20 from AutoConfiguration and you're set to go.

sfromis commented 1 year ago

The second relay of the THR316D is a dry relay, and not for mains voltage, for the terminals near where you connect the temperature probe.

anixi commented 1 year ago

I have used auto configuration but not Temperature visible, could probe be broken?