tasmota / mgos32-to-tasmota32

ESP32 Mongoose OS to Tasmota32 OTA updates for Shelly
GNU General Public License v3.0
145 stars 9 forks source link

New device: Shelly Plus RGBW PM #66

Closed nerdosity closed 1 week ago

nerdosity commented 1 month ago

image

https://kb.shelly.cloud/knowledge-base/shelly-plus-rgbw-pm

Still hadn't be able to caught the button and the onboard LED pin. Can you build a firmware for this? I would gladly test it. Maybe if you enable configuration on safe GPIOs I can test which one is which.

Edit: advice me how to search for the PM device please

nerdosity commented 1 month ago

image

image

image

image

image

Jason2866 commented 1 month ago

OTA Support should be easily to add. But first full Tasmota support should be done. @arendst Are you planning to buy one? Looks like a small job for you to add ;-)

Looks like a nice good made rgbw controller.

TD-er commented 1 month ago

No visible exposed pads at the bottom of the PCB? All vias look to be covered in soldermask and probing directly onto the ESP32 pins is rather tricky.

arendst commented 1 month ago

I'll order one and see if I can use PCBite to connect to it.

nerdosity commented 1 month ago

Yes, will post a lower photo of the downside. The usual header for shelly products is there.

Edit: Photo here

image

arendst commented 1 month ago

Still waiting for my order to arrive.

advice me how to search for the PM device please

From the pictures I see there is no specific PM device. They seem to use analog inputs to measure voltage and (total) current considering R001 at input. An Op-Amp (6331BP) is measuring voltage differences over R001 providing current used.

NOTE: Previous order cancelled due to long delivery time. Re-ordered at Shelly. TBC.

arendst commented 1 month ago

Almost there

image

nerdosity commented 1 month ago

Almost there

Was my pinout good?

arendst commented 1 month ago

Most. GPIO24 does not exist. It needs to be GPIO04 for the white channel

nerdosity commented 1 month ago

Did you checked if the inputs are galvanically insulated or not?

TD-er commented 1 month ago

Purely based on the pictures, I really doubt there will be any isolation.

arendst commented 1 month ago

Indeed, as can be seen on the pictures the inputs are connected to the ADC GPIOs using a resistor bridge. This bridge allows for connecting either a button or a 10k potentiometer. I have both working but currently ADC user configuration is very difficult using commands AdcParam for each GPIO as you need at least 7 of them for temperature, voltage, current and potentiometers/buttons. I'm adding a new command making more sense to operate.

arendst commented 1 month ago

Using latest dev branch you could play with Tasmota on Shelly Plus RGBW PM. See below info:

 * Template {"NAME":"Shelly Plus RGBW PM Pot.meter","GPIO":[1,0,0,0,419,0,0,0,0,0,544,0,0,0,0,1,0,0,1,0,0,416,417,418,0,0,0,0,0,4736,11264,11296,4704,0,4705,0],"FLAG":0,"BASE":1}
 * AdcParam1 1,32000,40000,3350      <- Temperature parameters
 * AdcParam2 1,1161,3472,10,30       <- Voltage parameters
 * AdcParam3 1,960,1017,0.01,0.706   <- Current parameters
 * AdcParam4 1,1552,176,3,1          <- I1 Potentiometer RGBW or RGB if SO37 128
 * AdcParam4 1,1552,176,3,3          <- I1 Potentiometer RGBW or RGB if SO37 128 without fading
 * AdcParam5 1,1552,176,3,1          <- I3 Potentiometer W if SO37 128
 * Fade 1
 * Speed 6
 * VoltRes 2
 * WattRes 2
 * 
 * Template {"NAME":"Shelly Plus RGBW PM Button","GPIO":[1,0,0,0,419,0,0,0,0,0,544,0,0,0,0,1,0,0,1,0,0,416,417,418,0,0,0,0,0,4736,11264,11296,4800,4801,4802,4803],"FLAG":0,"BASE":1}
 * AdcParam1 1,32000,40000,3350      <- Temperature parameters
 * AdcParam2 1,1161,3472,10,30       <- Voltage parameters
 * AdcParam3 1,960,1017,0.01,0.706   <- Current parameters
 * AdcParam4 1,511                   <- I1 Button
 * AdcParam5 1,511                   <- I2 Button
 * AdcParam6 1,511                   <- I3 Button
 * AdcParam7 1,511                   <- I4 Button
 * Fade 1
 * Speed 6
 * VoltRes 2
 * WattRes 2

image

nerdosity commented 1 month ago

Do you think we could use something like this? Screenshot_2024-08-04-23-04-59-81_b5f6883d2c20a96c53babc0b4ac88108 Even RX TX and GPIO0 are not galvanically safe, right?

I sourced an Adafruit Qwiic Twist RGB encoder and now I can't use it 😔

arendst commented 4 weeks ago

That's a rotary encoder but NOT a 10k potentiometer. Not sure if that would work considering the fact that the device only supports analog inputs and I have never tested the rotary encoder that way.

nerdosity commented 4 weeks ago

Do you think it's possible to use the I2C device above on other pins? Or are they all not insulated and not 5v safe?

I'm talking about the Adafruit Qwiic Twist RGB, not the encoder pictured above.

arendst commented 3 weeks ago

The I2C device is currently not supported by Tasmota.

The rotary encoder on the other hand is supported. I've connected my rotary encoder to the Shelly Plus RGBW and it works "out-of-the-box" (to my suprise). Apparently the analog inputs also work fine if configured as normal Buton, Switch or Rotary Encoder.

17:28:25.989 BTN: Button1 multi-press 1
17:28:26.492 SRC: Button
17:28:26.504 MQT: stat/plusrgbwpm/RESULT = {"POWER":"OFF"}
17:28:26.509 MQT: stat/plusrgbwpm/POWER = OFF
17:28:28.209 CFG: Saved, Count 211, Bytes 4096
17:28:29.660 SRC: Light
17:28:29.755 MQT: stat/plusrgbwpm/RESULT = {"POWER":"ON","Dimmer":60,"Color":"99999900","HSBColor":"0,0,60","White":0,"Channel":[60,60,60,0]}
17:28:30.047 MQT: stat/plusrgbwpm/RESULT = {"POWER":"ON","Dimmer":70,"Color":"B3B3B300","HSBColor":"0,0,70","White":0,"Channel":[70,70,70,0]}
17:28:30.996 MQT: stat/plusrgbwpm/RESULT = {"POWER":"ON","Dimmer":80,"Color":"CCCCCC00","HSBColor":"0,0,80","White":0,"Channel":[80,80,80,0]}
17:28:32.150 MQT: stat/plusrgbwpm/RESULT = {"POWER":"ON","Dimmer":90,"Color":"E6E6E600","HSBColor":"0,0,90","White":0,"Channel":[90,90,90,0]}
17:28:32.396 MQT: stat/plusrgbwpm/RESULT = {"POWER":"ON","Dimmer":100,"Color":"FFFFFF00","HSBColor":"0,0,100","White":0,"Channel":[100,100,100,0]}
17:28:32.651 MQT: stat/plusrgbwpm/RESULT = {"POWER":"ON","Dimmer":100,"Color":"FFFFFF00","HSBColor":"0,0,100","White":0,"Channel":[100,100,100,0]}
17:28:32.847 MQT: stat/plusrgbwpm/RESULT = {"POWER":"ON","Dimmer":100,"Color":"FFFFFF00","HSBColor":"0,0,100","White":0,"Channel":[100,100,100,0]}
17:28:33.048 MQT: stat/plusrgbwpm/RESULT = {"POWER":"ON","Dimmer":100,"Color":"FFFFFF00","HSBColor":"0,0,100","White":0,"Channel":[100,100,100,0]}
17:28:33.154 MQT: stat/plusrgbwpm/RESULT = {"POWER":"ON","Dimmer":100,"Color":"FFFFFF00","HSBColor":"0,0,100","White":0,"Channel":[100,100,100,0]}
17:28:33.367 MQT: stat/plusrgbwpm/RESULT = {"POWER":"ON","Dimmer":100,"Color":"FFFFFF00","HSBColor":"0,0,100","White":0,"Channel":[100,100,100,0]}
17:28:34.449 MQT: stat/plusrgbwpm/RESULT = {"POWER":"ON","Dimmer":90,"Color":"E6E6E600","HSBColor":"0,0,90","White":0,"Channel":[90,90,90,0]}
17:28:35.547 MQT: stat/plusrgbwpm/RESULT = {"POWER":"ON","Dimmer":80,"Color":"CCCCCC00","HSBColor":"0,0,80","White":0,"Channel":[80,80,80,0]}
17:28:36.050 MQT: stat/plusrgbwpm/RESULT = {"POWER":"ON","Dimmer":70,"Color":"B3B3B300","HSBColor":"0,0,70","White":0,"Channel":[70,70,70,0]}
17:28:36.657 MQT: stat/plusrgbwpm/RESULT = {"POWER":"ON","Dimmer":60,"Color":"99999900","HSBColor":"0,0,60","White":0,"Channel":[60,60,60,0]}
17:28:37.291 MQT: stat/plusrgbwpm/RESULT = {"POWER":"ON","Dimmer":50,"Color":"80808000","HSBColor":"0,0,50","White":0,"Channel":[50,50,50,0]}
17:28:37.844 MQT: stat/plusrgbwpm/RESULT = {"POWER":"ON","Dimmer":40,"Color":"66666600","HSBColor":"0,0,40","White":0,"Channel":[40,40,40,0]}
17:28:38.497 MQT: stat/plusrgbwpm/RESULT = {"POWER":"ON","Dimmer":30,"Color":"4D4D4D00","HSBColor":"0,0,30","White":0,"Channel":[30,30,30,0]}
17:28:39.152 MQT: stat/plusrgbwpm/RESULT = {"POWER":"ON","Dimmer":20,"Color":"33333300","HSBColor":"0,0,20","White":0,"Channel":[20,20,20,0]}
17:28:39.812 MQT: stat/plusrgbwpm/RESULT = {"POWER":"ON","Dimmer":10,"Color":"1A1A1A00","HSBColor":"0,0,10","White":0,"Channel":[10,10,10,0]}
17:28:41.197 SRC: Light
17:28:41.307 MQT: stat/plusrgbwpm/RESULT = {"POWER":"OFF","Dimmer":0,"Color":"00000000","HSBColor":"0,0,0","White":0,"Channel":[0,0,0,0]}
17:28:43.123 MQT: stat/plusrgbwpm/RESULT = {"POWER":"OFF","Dimmer":0,"Color":"00000000","HSBColor":"0,0,0","White":0,"Channel":[0,0,0,0]}
17:28:44.229 CFG: Saved, Count 212, Bytes 4096

Using this template

{"NAME":"Shelly Plus RGBW PM User","GPIO":[1,0,0,0,419,0,0,0,0,0,544,0,0,0,0,1,0,0,1,0,0,416,417,418,0,0,0,0,0,4736,11264,11296,1,1,1,1],"FLAG":0,"BASE":1}

and this module config: image

Angmar3019 commented 2 weeks ago

First of all, thank you for the great work here. I saw you already had success with the device and referenced the dev branch to test it. Since a new version has been released in the meantime, can I just flash it to test and then use one of your templates?

Do you know how long it will take until the device is fully supported like the other devices and a zip is available for download? Is there anything I can do to help with testing in the meantime?

arendst commented 2 weeks ago

Yes. v14.2.0 supports the Shelly Plus RGBW PM.

@Jason2866 how to go forward adding this to our mgos to tasmota site (if at all possible considering the latest FW changes of shelly denying our update procedure).

Jason2866 commented 2 weeks ago

@Angmar3019 For adding support i need the Shelly intern device name. This is visible on the main Shelly Web page from the device. With this i can look at the Shelly update server to fetch a Shelly update zip for the device. In the Shelly update package all Infos and "parts" are there to build the convert zip. So please provide a screenshot.

RavenSystem commented 2 weeks ago

PlusRGBWPM

Angmar3019 commented 2 weeks ago

My Shelly was still delivered with an old firmware under v1.4.x, so I could still test the upgrade process via OTA if needed.

image

Jason2866 commented 1 week ago

Update the Shelly firmware to latest available! else the device will get bricked!!!

To convert use this one https://github.com/tasmota/mgos32-to-tasmota32/releases/download/fw_v14/mgos32-to-tasmota32-PlusRGBWPM.zip for OTA convert of the Shelly RGBWPM. Follow the convert process as described. This version already takes care of the changes in newest Shelly firmware.

Angmar3019 commented 1 week ago

Many thanks for the advice and the new package. I will test it directly and give you feedback if it works.

Jason2866 commented 1 week ago

Mandantory is the Autoconfiguration step!!! Else you end in a bricked device! The device is already listed in the menu.

Angmar3019 commented 1 week ago

Great that is now the second device that has been successfully converted to tasmota with your help. Everything, including the memory expansion, worked perfectly. I have also tested all inputs and outputs with an LED strip and buttons and they all work.

Unfortunately the template that was included in your package and the one that @arendst has provided shows the wrong temperature for me.

image

The screenshot shows the button template since the wattage and voltage are also read incorrectly in my case.

arendst commented 1 week ago

In addition to the template you'll need a lot of other commands.

See below:

 * Template {"NAME":"Shelly Plus RGBW PM Pot.meter","GPIO":[1,0,0,0,419,0,0,0,0,0,544,0,0,0,0,1,0,0,1,0,0,416,417,418,0,0,0,0,0,4736,11264,11296,4704,0,4705,0],"FLAG":0,"BASE":1}
 * AdcGpio33 32000,40000,3350        <- Temperature parameters
 * AdcGpio34 1161,3472,10,30         <- Voltage parameters
 * AdcGpio35 960,1017,0.01,0.706     <- Current parameters
 * AdcGpio36 1552,176,3,1            <- I1 Potentiometer RGBW or RGB if SO37 128
 * AdcGpio36 1552,176,3,3            <- I1 Potentiometer RGBW or RGB if SO37 128 without fading
 * AdcGpio38 1552,176,3,1            <- I3 Potentiometer W if SO37 128
 * Fade 1
 * Speed 6
 * VoltRes 2
 * WattRes 2
 * 
 * Template {"NAME":"Shelly Plus RGBW PM Button","GPIO":[1,0,0,0,419,0,0,0,0,0,544,0,0,0,0,1,0,0,1,0,0,416,417,418,0,0,0,0,0,4736,11264,11296,4800,4801,4802,4803],"FLAG":0,"BASE":1}
 * AdcGpio33 32000,40000,3350        <- Temperature parameters
 * AdcGpio34 1161,3472,10,30         <- Voltage parameters
 * AdcGpio35 960,1017,0.01,0.706     <- Current parameters
 * AdcGpio36 511                     <- I1 ADC Button
 * AdcGpio37 511                     <- I2 ADC Button
 * AdcGpio38 511                     <- I3 ADC Button
 * AdcGpio39 511                     <- I4 ADC Button
 * Fade 1
 * Speed 6
 * VoltRes 2
 * WattRes 2
Angmar3019 commented 1 week ago

Oh thanks for the explanation, I didn't know that yet. Now the values are correct.

Jason2866 commented 1 week ago

added this settings to the Autoconfig template

 * AdcGpio33 32000,40000,3350        <- Temperature parameters
 * AdcGpio34 1161,3472,10,30         <- Voltage parameters
 * AdcGpio35 960,1017,0.01,0.706     <- Current parameters
 * Fade 1
 * Speed 6
 * VoltRes 2
 * WattRes 2
Jason2866 commented 1 week ago

Version is online in release section supporting Shelly fw >= v.14.x