reinhard-brandstaedter / solarflow-control

A tool to automatically control Zendure's Solarflow hub with more flexibility to match home power demand
70 stars 12 forks source link

shellypro3em no data in solarflow-control and solarflow-status #138

Closed dhaucke closed 7 months ago

dhaucke commented 7 months ago

Hey Reinhard,

big thanks for your work.

Could you help me with integrating shellypro3em, I think the problem is other json output format from shelly to mqtt.

Here some sample outputs from mqtt topic shellypro3em/status/em:0.

{"id":0,"a_current":1.201,"a_voltage":230.8,"a_act_power":145.4,"a_aprt_power":277.1,"a_pf":0.68,"a_freq":50.0,"b_current":1.042,"b_voltage":231.1,"b_act_power":90.3,"b_aprt_power":240.8,"b_pf":0.61,"b_freq":50.0,"c_current":1.916,"c_voltage":231.4,"c_act_power":358.3,"c_aprt_power":442.9,"c_pf":0.84,"c_freq":50.0,"n_current":null,"total_current":4.159,"total_act_power":594.006,"total_aprt_power":960.806, "user_calibrated_phase":[]}

and shellypro3em/status/emdata:0

{"id":0,"a_total_act_energy":115973.75,"a_total_act_ret_energy":0.00,"b_total_act_energy":118809.52,"b_total_act_ret_energy":0.00,"c_total_act_energy":110844.76,"c_total_act_ret_energy":1247.42,"total_act":345628.03, "total_act_ret":1247.42}

I hope this helps to rework smartmeters.py to get shellypro3em working.

reinhard-brandstaedter commented 7 months ago

Hi @dhaucke ,

thanks for sharing the the payload of a 3EM Pro. I actually think your should be able to use it right away with a "generic" smartmeter configuration and the correct accessors:

[smartmeter]
base_topic = shellypro3em/status/em:0
# if the published value at the base_topic is a JSON type then these accessors are used to get the power values
# e.g. if Smartmeter reader posts { "Power": {"Power_curr": 120, "Total_in": 12345.6} }
cur_accessor = total_act_power
total_accessor = total_aprt_power

Is this: shellypro3em/status/em:0 the actual MQTT topic? The ":0" looks strange? Not sure if colons are allowed in topic names?

dhaucke commented 7 months ago

Hi Reinhard,

Screenshort from MQTT-Explorer. Bildschirmfoto 2024-02-29 um 18 26 28

thanks for that I will try it

dhaucke commented 7 months ago

Hi Reinhard, thanks, now I can see the smartmeter data, too

ghost commented 5 months ago

what ist the diffrence/meaning of cur_accessor and total_accessor ? in shelly terms: total_act_power is the current Power of all 3 phases combined mesured in W total_aprt_power is the current Apparent Power of all 3 phases combinde (scheinleistung) mesured in VA

i am fine with cur_accessor = total_act_power but what does total_accessor mean ?

reinhard-brandstaedter commented 5 months ago

It’s just the field within the json payload, or - if multiple nested fields the path to it separated by dots. The total_accessor is not used but it was/could be used to get a total reading of the smartmeter (not really useful for shelly EM3.