suletom / EASUN-ISOLAR-SMX-II-CONTROL

Documentation collection about controlling an EASUN-ISOLAR-SMX-II chinese off-grid solar inverter
GNU General Public License v3.0
37 stars 12 forks source link

Home Assistant sensors #8

Open Pi3tia opened 1 year ago

Pi3tia commented 1 year ago

Hi, How to configure Home Assistant to read data from easun. Everything seems fine on the notebook and the console output is ok. I ran "npm run-script gen-ha-config" and I copied the template to device with HA, but I need the currentdata.json file in the config.

Sorry if this is a stupid question.

Thank you from the mountain.

suletom commented 1 year ago

Hi,currentdata.json is updated at every script run(scheduled in crontab) I prefer putting a symlink pointing to the json to  the HA base directory (where the main HA config file is located)  On my docker based install this directory is located under /optTom-------- Eredeti levél --------Feladó: Piotr Piecuch @.>Dátum: 2023 november 4 17:02:24Tárgy: [suletom/EASUN-ISOLAR-SMX-II-CONTROL] Home Assistant sensors (Issue #8)Címzett: suletom/EASUN-ISOLAR-SMX-II-CONTROL @.>Hi, How to configure Home Assistant to read data from easun. Everything seems fine on the notebook and the console output is ok. I ran "npm run-script gen-ha-config" and I copied the template to device with HA, but I need the currentdata.json file in the configuration.Sorry if this is a stupid question.Thank you from the mountain.—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

portalek commented 11 months ago

Hi, can you please create more comprehensive description how to get data to HA? I can run the script, but currentdata.json are empty. Thank you, great work.

vmannoor commented 4 months ago

First of all thank you for your efforts and great work. I managed obtain data from the data logger using npm start get-smx-param [datalogger ip address] 104 command:

104 MachineState:                4  => Running in line
105 CurrentFault:                FAULT0: 0: OK FAULT1: 0: OK FAULT2: 0: OK FAULT3: 0: OK
106 PVVoltage:           0.0 V
107 PVCurrent:           0.0 A
108 PVPower:             0.0 W
109 LineVoltage:                 222.4 V
110 LineCurrent:                 2.8 A
111 LineFrequency:               49.97 Hz
112 BatteryVoltage:              27.7 V
113 BatteryCurrent:              -4.3 A
114 BattreySoc:          100 %
115 ChargeCurrentByLine:                 4.3 A
116 LoadVoltage:                 223.1 V
117 LoadCurrent:                 2.8 A
118 LoadActivePower:             471 W
119 LoadApparentPower:           601 VA
120 LoadRatio:           16 %
121 TemperatureDC:               33.8 ˚C
122 TemperatureAC:               38.0 ˚C
123 TemperatureTR:               47.8 ˚C
124 InverterCurrent:             0.0 A
125 InverterFrequency:           49.99 Hz
126 BatteryChargeStep:           4  => Float charge
127 BusVoltage:          436.4 V
128 LoadPowerConsumptionOnTheDay:                1.9 KWH
129 LoadPowerConsumptionOnTheDayFromMains:               1.3 KWH
130 PVCumulativePowerGeneration:                 0.0 KWH
131 CumulativeCharge:            2807.1 AH
132 AccumulatedBatteryChargeHours:               29680 AH
133 AccumulatedBatteryDischargeTime:             2217 AH
134 LoadCumulativePowerConsumption:              224.3 KWH
135 AccumulatedLoadFromMainsConsumption:                 158.0 KWH
136 PVPowerGenerationOnTheDay:           0.0 KWH
137 BatteryChargeOnTheDay:               68 AH
138 BatteryDischargeOnTheDay:            23 AH

I also created the templates I want to use in HA, could you please explain which script I should run periodically to write this data into json file. 'currentdata.json' in my directory is empty.

suletom commented 4 months ago

My former setup were the following crontab entries. The first should create currentdata.json at a successful run. The second needed for me to copy the file to the mount directory where docker hosted HomeAssistant was available in the filesystem:/5 root cd /home/suletom/test/EASUN-ISOLAR-SMX-II-CONTROL && npm start get-smx-param 192.168.1.xxx > /home/suletom/test/icmddate +\%Y\%m\%d\%H\%M\%S.log 2>&1 root cp /home/suletom/test/EASUN-ISOLAR-SMX-II-CONTROL/currentdata.json /opt/currentdata.jsonNow i'm not using HA anymore, beacause in the dev branch the current version has integrated web server with chart and email/telegram notifications support and basic energy management based on weather forecast and lot of other mostly bleeding edge extra features i'm currently testing in production. Now i'm focusing on adding support for dynamic load switching, but not planning a stable release at the near future. If you have some time feel free to try the dev code.-------- Eredeti levél --------Feladó: vmannoor @.>Dátum: 2024 június 29 21:16:59Tárgy: Re: [suletom/EASUN-ISOLAR-SMX-II-CONTROL] Home Assistant sensors (Issue #8)Címzett: suletom/EASUN-ISOLAR-SMX-II-CONTROL @.>First of all thank you for your efforts and great work. I managed obtain data from the data logger using npm start get-smx-param [datalogger ip address] 104 command:104 MachineState: 4 => Running in line 105 CurrentFault: FAULT0: 0: OK FAULT1: 0: OK FAULT2: 0: OK FAULT3: 0: OK 106 PVVoltage: 0.0 V 107 PVCurrent: 0.0 A 108 PVPower: 0.0 W 109 LineVoltage: 222.4 V 110 LineCurrent: 2.8 A 111 LineFrequency: 49.97 Hz 112 BatteryVoltage: 27.7 V 113 BatteryCurrent: -4.3 A 114 BattreySoc: 100 % 115 ChargeCurrentByLine: 4.3 A 116 LoadVoltage: 223.1 V 117 LoadCurrent: 2.8 A 118 LoadActivePower: 471 W 119 LoadApparentPower: 601 VA 120 LoadRatio: 16 % 121 TemperatureDC: 33.8 ˚C 122 TemperatureAC: 38.0 ˚C 123 TemperatureTR: 47.8 ˚C 124 InverterCurrent: 0.0 A 125 InverterFrequency: 49.99 Hz 126 BatteryChargeStep: 4 => Float charge 127 BusVoltage: 436.4 V 128 LoadPowerConsumptionOnTheDay: 1.9 KWH 129 LoadPowerConsumptionOnTheDayFromMains: 1.3 KWH 130 PVCumulativePowerGeneration: 0.0 KWH 131 CumulativeCharge: 2807.1 AH 132 AccumulatedBatteryChargeHours: 29680 AH 133 AccumulatedBatteryDischargeTime: 2217 AH 134 LoadCumulativePowerConsumption: 224.3 KWH 135 AccumulatedLoadFromMainsConsumption: 158.0 KWH 136 PVPowerGenerationOnTheDay: 0.0 KWH 137 BatteryChargeOnTheDay: 68 AH 138 BatteryDischargeOnTheDay: 23 AHI also created the templates I want to use in HA, could you please explain how which script I should run periodically to write this data into json file. currentdata.json in my directory is empty.—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

vmannoor commented 4 months ago

My former setup were the following crontab entries. The first should create currentdata.json at a successful run. The second needed for me to copy the file to the mount directory where docker hosted HomeAssistant was available in the filesystem:/5 root cd /home/suletom/test/EASUN-ISOLAR-SMX-II-CONTROL && npm start get-smx-param 192.168.1.xxx > /home/suletom/test/icmddate +\%Y\%m\%d\%H\%M\%S.log 2>&1 root cp /home/suletom/test/EASUN-ISOLAR-SMX-II-CONTROL/currentdata.json /opt/currentdata.jsonNow i'm not using HA anymore, beacause in the dev branch the current version has integrated web server with chart and email/telegram notifications support and basic energy management based on weather forecast and lot of other mostly bleeding edge extra features i'm currently testing in production. Now i'm focusing on adding support for dynamic load switching, but not planning a stable release at the near future. If you have some time feel free to try the dev code.-------- Eredeti levél --------Feladó: vmannoor @.>Dátum: 2024 június 29 21:16:59Tárgy: Re: [suletom/EASUN-ISOLAR-SMX-II-CONTROL] Home Assistant sensors (Issue #8)Címzett: suletom/EASUN-ISOLAR-SMX-II-CONTROL @.>First of all thank you for your efforts and great work. I managed obtain data from the data logger using npm start get-smx-param [datalogger ip address] 104 command:104 MachineState: 4 => Running in line 105 CurrentFault: FAULT0: 0: OK FAULT1: 0: OK FAULT2: 0: OK FAULT3: 0: OK 106 PVVoltage: 0.0 V 107 PVCurrent: 0.0 A 108 PVPower: 0.0 W 109 LineVoltage: 222.4 V 110 LineCurrent: 2.8 A 111 LineFrequency: 49.97 Hz 112 BatteryVoltage: 27.7 V 113 BatteryCurrent: -4.3 A 114 BattreySoc: 100 % 115 ChargeCurrentByLine: 4.3 A 116 LoadVoltage: 223.1 V 117 LoadCurrent: 2.8 A 118 LoadActivePower: 471 W 119 LoadApparentPower: 601 VA 120 LoadRatio: 16 % 121 TemperatureDC: 33.8 ˚C 122 TemperatureAC: 38.0 ˚C 123 TemperatureTR: 47.8 ˚C 124 InverterCurrent: 0.0 A 125 InverterFrequency: 49.99 Hz 126 BatteryChargeStep: 4 => Float charge 127 BusVoltage: 436.4 V 128 LoadPowerConsumptionOnTheDay: 1.9 KWH 129 LoadPowerConsumptionOnTheDayFromMains: 1.3 KWH 130 PVCumulativePowerGeneration: 0.0 KWH 131 CumulativeCharge: 2807.1 AH 132 AccumulatedBatteryChargeHours: 29680 AH 133 AccumulatedBatteryDischargeTime: 2217 AH 134 LoadCumulativePowerConsumption: 224.3 KWH 135 AccumulatedLoadFromMainsConsumption: 158.0 KWH 136 PVPowerGenerationOnTheDay: 0.0 KWH 137 BatteryChargeOnTheDay: 68 AH 138 BatteryDischargeOnTheDay: 23 AHI also created the templates I want to use in HA, could you please explain how which script I should run periodically to write this data into json file. currentdata.json in my directory is empty.—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

Thanks for the feedback! I found a possible error in the code that was stopping the JSON file from being created. I fixed it, and now everything is working perfectly. Thanks again for all the work you have done to make this thing work —it was driving me nuts for weeks! I couldn’t find any other working solutions for this inverter.