StyraHem / pyShelly

Library for Shelly smart home devices
MIT License
67 stars 45 forks source link

Shelly Plus PM Mini support #78

Open andrepcg opened 1 year ago

andrepcg commented 1 year ago

https://www.shelly.com/en/products/shop/shelly-plus-pm-mini

Topic: shellypmmini-6055f999dfd4/status/pm1:0 {"id":0, "voltage":238.3, "current":0.020, "apower":1.6 ,"freq":50.0,"aenergy":{"total":12.948,"by_minute":[0.000,0.000,0.000],"minute_ts":1698852539}}

Topic: shellypmmini-6055f999dfd4/events/rpc {"src":"shellypmmini-6055f999dfd4","dst":"shellypmmini-6055f999dfd4/events","method":"NotifyStatus","params":{"ts":1698852540.24,"pm1:0":{"id":0,"aenergy":{"by_minute":[0.000,0.000,0.000],"minute_ts":1698852539,"total":12.948}}}}

Doesn't have a switch.

imagem

andrepcg commented 1 year ago

I tried adding the definition in const.py and also update block.py to support it but in homeassistant it shows like this: imagem

Maybe because the topic is in a different format? Topic is shellypmmini-6055f999dfd4/status/pm1:0. Compared to the Shelly Plus 1PM which is shellyplus1pm-44179399f480/status/switch:0

andrepcg commented 1 year ago

@hakana Since you're more familiar with the code, what do you think the cause could be?