softwarecrash / Solar2MQTT

ESP8266 based WiFi and MQTT interface for MPPT Inverters that use watchpower
Other
149 stars 33 forks source link

[Bug]: 1.2.0-Pre4 null values in MQTT, correct values in web #158

Open valqk opened 14 hours ago

valqk commented 14 hours ago

Is there an existing issue for this?

Used Hardware?

Other (please write your hardware in 'What happened?')

What happened?

Using Nodemcu v3 with pin 6,7 soldered + mas3232 mini board + crimped RJ45, attached to EASUN iGrid SV IV 5.6KW Website works fine and values shown in web reads fine and are correct - meaning the communication with the inverter is fine. Got MQTT in Home Assistant installed, up& running, with user/pass set. mosquitto_sub shows strings, etc. Issue is that when I check MQTT Json Style I get no msgs in mqtt (listening for all topics). At some point it was sending

homeassistant/sensor/Solar01/AC_in_rating_current/config (null)
homeassistant/sensor/Solar01/AC_in_rating_voltage/config (null)
homeassistant/sensor/Solar01/AC_out_rating_active_power/config (null)
homeassistant/sensor/Solar01/AC_out_rating_apparent_power/config (null)
homeassistant/sensor/Solar01/AC_out_rating_current/config (null)

and now it's not. No idea why. Can't get itsending. When I set the HA Discovery check, I start get msgs like those:

....
homeassistant/sensor/Solar01/PV_Charging_Power/config {"name":"PV_Charging_Power","stat_t":"Solar01/LiveData/PV_Charging_Power","avty_t":"Solar01/Alive","pl_avail": "true","pl_not_avail": "false","uniq_id":"EaSun-inv1-solar2mqtt-8C2B8E.PV_Charging_Power","ic":"mdi:solar-power-variant","unit_of_meas":"W","dev_cla":"power","dev":{"ids":["EaSun-inv1-solar2mqtt-8C2B8E"],"name":"EaSun-inv1-solar2mqtt","cu":"http://172.16.20.66","mdl":"null","mf":"SoftWareCrash","sw":"1.2.0-Pre4"}}
homeassistant/sensor/Solar01/PV_generation_day/config {"name":"PV_generation_day","stat_t":"Solar01/LiveData/PV_generation_day","avty_t":"Solar01/Alive","pl_avail": "true","pl_not_avail": "false","uniq_id":"EaSun-inv1-solar2mqtt-8C2B8E.PV_generation_day","ic":"mdi:solar-power-variant","unit_of_meas":"Wh","dev_cla":"energy","dev":{"ids":["EaSun-inv1-solar2mqtt-8C2B8E"],"name":"EaSun-inv1-solar2mqtt","cu":"http://172.16.20.66","mdl":"null","mf":"SoftWareCrash","sw":"1.2.0-Pre4"}}
homeassistant/sensor/Solar01/PV_generation_month/config {"name":"PV_generation_month","stat_t":"Solar01/LiveData/PV_generation_month","avty_t":"Solar01/Alive","pl_avail": "true","pl_not_avail": "false","uniq_id":"EaSun-inv1-solar2mqtt-8C2B8E.PV_generation_month","ic":"mdi:solar-power-variant","unit_of_meas":"Wh","dev_cla":"energy","dev":{"ids":["EaSun-inv1-solar2mqtt-8C2B8E"],"name":"EaSun-inv1-solar2mqtt","cu":"http://172.16.20.66","mdl":"null","mf":"SoftWareCrash","sw":"1.2.0-Pre4"}}
homeassistant/sensor/Solar01/PV_generation_sum/config {"name":"PV_generation_sum","stat_t":"Solar01/LiveData/PV_generation_sum","avty_t":"Solar01/Alive","pl_avail": "true","pl_not_avail": "false","uniq_id":"EaSun-inv1-solar2mqtt-8C2B8E.PV_generation_sum","ic":"mdi:solar-power-variant","unit_of_meas":"Wh","dev_cla":"energy","dev":{"ids":["EaSun-inv1-solar2mqtt-8C2B8E"],"name":"EaSun-inv1-solar2mqtt","cu":"http://172.16.20.66","mdl":"null","mf":"SoftWareCrash","sw":"1.2.0-Pre4"}}
homeassistant/sensor/Solar01/PV_generation_year/config {"name":"PV_generation_year","stat_t":"Solar01/LiveData/PV_generation_year","avty_t":"Solar01/Alive","pl_avail": "true","pl_not_avail": "false","uniq_id":"EaSun-inv1-solar2mqtt-8C2B8E.PV_generation_year","ic":"mdi:solar-power-variant","unit_of_meas":"Wh","dev_cla":"energy","dev":{"ids":["EaSun-inv1-solar2mqtt-8C2B8E"],"name":"EaSun-inv1-solar2mqtt","cu":"http://172.16.20.66","mdl":"null","mf":"SoftWareCrash","sw":"1.2.0-Pre4"}}
homeassistant/sensor/Solar01/PV_Input_Current/config {"name":"PV_Input_Current","stat_t":"Solar01/LiveData/PV_Input_Current","avty_t":"Solar01/Alive","pl_avail": "true","pl_not_avail": "false","uniq_id":"EaSun-inv1-solar2mqtt-8C2B8E.PV_Input_Current","ic":"mdi:solar-power-variant","unit_of_meas":"A","dev_cla":"current","dev":{"ids":["EaSun-inv1-solar2mqtt-8C2B8E"],"name":"EaSun-inv1-solar2mqtt","cu":"http://172.16.20.66","mdl":"null","mf":"SoftWareCrash","sw":"1.2.0-Pre4"}}
homeassistant/sensor/Solar01/PV_Input_Voltage/config {"name":"PV_Input_Voltage","stat_t":"Solar01/LiveData/PV_Input_Voltage","avty_t":"Solar01/Alive","pl_avail": "true","pl_not_avail": "false","uniq_id":"EaSun-inv1-solar2mqtt-8C2B8E.PV_Input_Voltage","ic":"mdi:solar-power-variant","unit_of_meas":"V","dev_cla":"voltage","dev":{"ids":["EaSun-inv1-solar2mqtt-8C2B8E"],"name":"EaSun-inv1-solar2mqtt","cu":"http://172.16.20.66","mdl":"null","mf":"SoftWareCrash","sw":"1.2.0-Pre4"}}
homeassistant/sensor/Solar01/Tracker_temperature/config {"name":"Tracker_temperature","stat_t":"Solar01/LiveData/Tracker_temperature","avty_t":"Solar01/Alive","pl_avail": "true","pl_not_avail": "false","uniq_id":"EaSun-inv1-solar2mqtt-8C2B8E.Tracker_temperature","ic":"mdi:thermometer-lines","unit_of_meas":"°C","dev_cla":"temperature","dev":{"ids":["EaSun-inv1-solar2mqtt-8C2B8E"],"name":"EaSun-inv1-solar2mqtt","cu":"http://172.16.20.66","mdl":"null","mf":"SoftWareCrash","sw":"1.2.0-Pre4"}}
homeassistant/sensor/Solar01/Transformer_temperature/config {"name":"Transformer_temperature","stat_t":"Solar01/LiveData/Transformer_temperature","avty_t":"Solar01/Alive","pl_avail": "true","pl_not_avail": "false","uniq_id":"EaSun-inv1-solar2mqtt-8C2B8E.Transformer_temperature","ic":"mdi:thermometer-lines","unit_of_meas":"°C","dev_cla":"temperature","dev":{"ids":["EaSun-inv1-solar2mqtt-8C2B8E"],"name":"EaSun-inv1-solar2mqtt","cu":"http://172.16.20.66","mdl":"null","mf":"SoftWareCrash","sw":"1.2.0-Pre4"}}
....

Screenshots / Fotos

Wiring works fine.

Steps To Reproduce

No response

Version

1.x.x and above

Relevant livejson output

{"EspData":{"Device_name":"EaSun-inv1-solar2mqtt","ESP_VCC":3.012,"Wifi_RSSI":-41,"sw_version":"1.2.0-Pre4","Free_Heap":15552,"HEAP_Fragmentation":2,"json_memory_usage":1356,"json_capacity":2048,"runtime":22,"ws_clients":0,"detect_protocol":1},"DeviceData":{"AC_in_rating_voltage":220,"AC_in_rating_current":25.4,"AC_out_rating_voltage":220,"AC_out_rating_frequency":50,"AC_out_rating_current":25.4,"AC_out_rating_apparent_power":5600,"AC_out_rating_active_power":5600,"Battery_rating_voltage":48,"Battery_re-charge_voltage":50,"Battery_re-discharge_voltage":0,"Battery_under_voltage":46,"Battery_bulk_voltage":57,"Battery_float_voltage":57,"Battery_type":"User","Current_max_AC_charging_current":20,"Current_max_charging_current":120,"Input_voltage_range":"Appliance","Output_source_priority":"Solar-Battery-Utility","Charger_source_priority":"Solar first","Parallel_max_num":9,"Machine_type":"Off-grid Tie","Topology":"Transformerless","Output_mode":"Phase 1 of three phaseoutput","Solar_power_priority":"Load-Battery-Utility","MPPT_string":1,"Protocol_ID":18},"LiveData":{"AC_in_Voltage":240.5,"AC_in_Frequenz":50,"AC_out_Voltage":219.8,"AC_out_Frequenz":49.9,"AC_out_VA":197,"AC_out_Watt":171,"AC_out_percent":3,"Battery_Voltage":52.6,"Battery_SCC_Volt":0,"Battery_SCC2_Volt":0,"Battery_Discharge_Current":4,"Battery_Charge_Current":0,"Battery_Percent":71,"Inverter_Bus_Temperature":34,"MPPT1_Charger_Temperature":0,"MPPT2_Charger_Temperature":0,"PV1_Input_Power":0,"PV2_Input_Power":0,"PV1_Input_Voltage":0,"PV2_Input_Voltage":0,"Configuration_State":0,"MPPT1_Charger_Status":0,"MPPT2_CHarger_Status":0,"Load_Connection":1,"Battery_Power_Direction":2,"ACDC_Power_Direction":2,"Line_Power_Direction":0,"Local_Parallel_ID":0,"PV_Input_Voltage":0,"PV_Charging_Power":0,"PV_Input_Current":0,"Battery_Load":-4,"Inverter_Operation_Mode":"Battery","Time_until_absorb_charge":0,"Time_until_float_charge":10,"Tracker_temperature":0,"Inverter_temperature":0,"Battery_temperature":0,"Transformer_temperature":34,"Fan_speed":0,"Inverter_charge_state":30,"PV_generation_day":0,"PV_generation_month":55599,"PV_generation_year":55599,"PV_generation_sum":55599}}

What browsers are you seeing the problem on?

Chrome

valqk commented 14 hours ago

BTW, this option is incorrect: "Output_mode": "Phase 1 of three phaseoutput", The output mode is in parallel (currently 2 inverters in paralel, having issues wtih 3rd one - says it's in Phase 3 of three phaseout and rises error when turned on. Still debuging). This one is working fine with the other one though.

softwarecrash commented 7 hours ago

First, please try the Last non-pre Release, the pre releases are Beta and can have Bugs. Mqtt json Style AND Homeassistant will Not Work.

the output mode can wrong, i doent have a array of devices and cant test it right, need a correction later.

can you ask your seller/vendor for a protocol sheet?

please use mqttexplorer to check for incoming topics

valqk commented 5 hours ago

OK, I'll try it, but how to build the project? Are you using vscode? The web installer has only the pre release avaliable to install... I'm using arduino IDE and the file structure is not compatible with it.

softwarecrash commented 5 hours ago

you dont need to compile itself, use ready to use files https://github.com/softwarecrash/Solar2MQTT/releases use tasmotizer to flash it or over webui firmware update

valqk commented 5 hours ago

Hm, just started to try to adopt it to Arduino IDE and came up with #include is missing. Lib installed but include requires #include I'll try with the binary. How do you compile it anyway?

softwarecrash commented 5 hours ago

used vscode+pio

valqk commented 1 hour ago

Thanks. Will try vscode+pio. In 1.1.8 values are populated to MQTT properly and HA can see them. Should I close that bug or leave it open, so I test the Pre4/5 when you say it's fixed? Also in 1.18 the Output_mode = Phase 1 of three phaseoutput is still incorrect. Inverter is currently in Parallel mode.

softwarecrash commented 1 hour ago

can you check with mqttexplorer that what values are send? so i can fix it, leave it open for future testing. for the output mode, can you copy me the debug output from mqtt, its under /raw