somlioy / amina_s

Zigbee2MQTT external converter for Amina S EV Charger
9 stars 1 forks source link

Log spamming #22

Closed magicus closed 1 week ago

magicus commented 1 week ago

It turns out my Amina S integration has been rapidly filling up my Home Assistant database, generating gigabytes in just a couple of days. I've worked around the problem for now by excluding all data from that device in the recorder, but that's not good - I really want to store the energy consumption, for instance!

So I started to try and figure out why this is the case. It seems that the converter is pushing a lot of MQTT updates; if I turn on "info" level logs in Z2M, I get a ton of Amina updates. Every fifth second, it pushes out something like this, which each message repeated 8 times:

2024-11-07 18:39:13z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/laddbox', payload '{"ac_frequency":500,"ac_frequency_10":500,"alarm_active":false,"alarms":"No Alarm","charge_limit":16,"charging":true,"current":12.85,"current_10":0,"current_phase_b":0,"current_phase_c":0,"derated":false,"elapsed":3421,"enable_offline":"Disable","ev_connected":true,"ev_status":"Charging","last_seen":"2024-11-07T17:39:13.230Z","last_session_energy":0.98,"linkquality":255,"offline_current":16,"offline_single_phase":"Disable","power":2929,"power_10":0,"power_phase_b":0,"power_phase_c":0,"single_phase":"Disable","state":"ON","time_to_offline":0,"total_active_energy":58.54,"total_active_power":2.93,"update":{"installed_version":17301554,"latest_version":17301554,"state":"idle"},"update_available":false,"voltage":228,"voltage_10":241,"voltage_phase_b":238,"voltage_phase_b_10":238,"voltage_phase_c":237,"voltage_phase_c_10":238}'

info 2024-11-07 18:39:13z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/laddbox', payload '{"ac_frequency":500,"ac_frequency_10":500,"alarm_active":false,"alarms":"No Alarm","charge_limit":16,"charging":true,"current":12.85,"current_10":0,"current_phase_b":0,"current_phase_c":0,"derated":false,"enable_offline":"Disable","ev_connected":true,"ev_status":"Charging","last_seen":"2024-11-07T17:39:13.230Z","last_session_energy":0.98,"linkquality":255,"offline_current":16,"offline_single_phase":"Disable","power":2929,"power_10":0,"power_phase_b":0,"power_phase_c":0,"single_phase":"Disable","state":"ON","time_to_offline":0,"total_active_energy":58.54,"total_active_power":2.93,"update":{"installed_version":17301554,"latest_version":17301554,"state":"idle"},"update_available":false,"voltage":228,"voltage_10":241,"voltage_phase_b":238,"voltage_phase_b_10":238,"voltage_phase_c":237,"voltage_phase_c_10":238}'
info 2024-11-07 18:39:14z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/laddbox', payload '{"ac_frequency":500,"ac_frequency_10":500,"alarm_active":false,"alarms":"No Alarm","charge_limit":16,"charging":true,"current":12.85,"current_10":0,"current_phase_b":0,"current_phase_c":0,"derated":false,"elapsed":1436,"enable_offline":"Disable","ev_connected":true,"ev_status":"Charging","last_seen":"2024-11-07T17:39:14.654Z","last_session_energy":0.98,"linkquality":255,"offline_current":16,"offline_single_phase":"Disable","power":2929,"power_10":0,"power_phase_b":0,"power_phase_c":0,"single_phase":"Disable","state":"ON","time_to_offline":0,"total_active_energy":58.54,"total_active_power":2.95,"update":{"installed_version":17301554,"latest_version":17301554,"state":"idle"},"update_available":false,"voltage":228,"voltage_10":241,"voltage_phase_b":238,"voltage_phase_b_10":238,"voltage_phase_c":237,"voltage_phase_c_10":238}'

info 2024-11-07 18:39:14z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/laddbox', payload '{"ac_frequency":500,"ac_frequency_10":500,"alarm_active":false,"alarms":"No Alarm","charge_limit":16,"charging":true,"current":12.85,"current_10":0,"current_phase_b":0,"current_phase_c":0,"derated":false,"elapsed":4,"enable_offline":"Disable","ev_connected":true,"ev_status":"Charging","last_seen":"2024-11-07T17:39:14.654Z","last_session_energy":0.98,"linkquality":255,"offline_current":16,"offline_single_phase":"Disable","power":2929,"power_10":0,"power_phase_b":0,"power_phase_c":0,"single_phase":"Disable","state":"ON","time_to_offline":0,"total_active_energy":58.54,"total_active_power":2.95,"update":{"installed_version":17301554,"latest_version":17301554,"state":"idle"},"update_available":false,"voltage":228,"voltage_10":241,"voltage_phase_b":238,"voltage_phase_b_10":238,"voltage_phase_c":237,"voltage_phase_c_10":238}'
info 2024-11-07 18:39:14z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/laddbox', payload '{"ac_frequency":500,"ac_frequency_10":500,"alarm_active":false,"alarms":"No Alarm","charge_limit":16,"charging":true,"current":12.85,"current_10":0,"current_phase_b":0,"current_phase_c":0,"derated":false,"elapsed":140,"enable_offline":"Disable","ev_connected":true,"ev_status":"Charging","last_seen":"2024-11-07T17:39:14.818Z","last_session_energy":0.98,"linkquality":255,"offline_current":16,"offline_single_phase":"Disable","power":2929,"power_10":0,"power_phase_b":0,"power_phase_c":0,"single_phase":"Disable","state":"ON","time_to_offline":0,"total_active_energy":58.54,"total_active_power":2.95,"update":{"installed_version":17301554,"latest_version":17301554,"state":"idle"},"update_available":false,"voltage":228,"voltage_10":241,"voltage_phase_b":238,"voltage_phase_b_10":238,"voltage_phase_c":237,"voltage_phase_c_10":238}'

From what I can tell, the messages are identical, except for the elapsed field, which has an (random?) integer in each field.

Even a reporting every fifth second for values that does not change seem much (but it might be limitations in the Z2M model to do anything about that?), it should not have to be repeated 8 times.

somlioy commented 1 week ago

Hmm... Could it be these attributes which apparantly got 0 sec min rep interval. Try increasing them to 10 for example image

Also try to reconfigure the device (yellow button) As for me, I can't see any spamming in MQTT explorer atleast.

Thinking about it those attributes dosent change much so spamming should be protected by min change aswell

magicus commented 1 week ago

So how often do you see a MQTT publish: topic 'zigbee2mqtt/laddbox' in your Z2M log? Is it regularly updated, or only when a value changes?

magicus commented 1 week ago

Hm, I don't know what happened, but now it stopped. It might be that I reconfigured the device.

somlioy commented 1 week ago

Yeah, only on value changes or if I refresh one attribute manually.

Strange ... I must say I've never seen that problem before.