Can you share this dashboard? Thk
Does anyone know how to set the working mode
of the Huawei Inverter over the HA REST API with this integration ?
a POST to http://homeassistant.local:8123/api/states/select.battery_working_mode
doesn’t work
Thanks John for YAML syntax
Converted to json for use in node red " call service" node:
{“periods”:“12:20-12:30/1234567/-\n12:40-12:50/1234567/+”,“device_id”:“4f1c2381da520ac3261aed46ff17811b”}
It works, but it takes several minutes to uptade on fusionsolar
Simplest way, edit the service call in developer tools using UI mode you can choose the device, then switch back to UI and it’ll show you the device id.
There’s probably another way but that’s the only way I can remember
thanks for help
after i understood it’s an HA id and not huawei id, it was more easy to find
Fastest way is from URL
I’m not trying to change the TOU periods, just trying to set the working mode to “Time Of Use”.
a GET to http://homeassistant.local:8123/api/states/select.battery_working_mode
returns
{
"entity_id": "select.battery_working_mode",
"state": "Maximise Self Consumption",
"attributes": {
"options": [
"Maximise Self Consumption",
"Time Of Use",
"Fully Fed To Grid"
],
"friendly_name": "Battery Working Mode"
},
...
}
The state is updated correctly to “Time of Use” after changing in the dashboard
{
"entity_id": "select.battery_working_mode",
"state": "Time Of Use",
...
}
So definately the correct state variable.
The change is also reflected when reading the modbus variable and after some time in the Huawei app.
Sending a POST request (with body { "state": "Time Of Use" }
) to the same URL SHOULD and DOES change the HA state: a subsequent GET request returns
{
"entity_id": "select.battery_working_mode",
"state": "Time Of Use",
...
}
However, the UI is now broken
and the inverter did NOT change it’s working state, not according to the Huawei app and not according to the modbus state.
I’m use node red and the select service, in there it’s “option” : “Time of Use”, I suspect it’s the same for your command?
@lorrainem77, nope, with option
I get an error
I find this error in debug log, not sure what it means homeassistant.exceptions.HomeAssistantError: Entity sensor.battery_time_of_use_periods cannot be added as the entity category is set to config
@cailloup Which node are you using to send the instruction ?in node-red ?
Can you post the flow you’re using ?
Hello,
I’have reinstall the integration with the advanced settings. but many sensor of the battery are not available. Exemple :
would you know why?
Thanks for your help
Flow
[{“id”:“03a07ff174a11e10”,“type”:“tab”,“label”:“ESS charging”,“disabled”:false,“info”:“”,“env”:},{“id”:“8ff595318edc8f68”,“type”:“server-state-changed”,“z”:“03a07ff174a11e10”,“name”:“Tempo demain”,“server”:“e187081d.522548”,“version”:4,“exposeToHomeAssistant”:false,“haConfig”:[{“property”:“name”,“value”:“”},{“property”:“icon”,“value”:“”}],“entityidfilter”:“sensor.tempo_demain”,“entityidfiltertype”:“exact”,“outputinitially”:true,“state_type”:“str”,“haltifstate”:“”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“outputs”:1,“output_only_on_state_change”:false,“for”:“0”,“forType”:“num”,“forUnits”:“minutes”,“ignorePrevStateNull”:false,“ignorePrevStateUnknown”:false,“ignorePrevStateUnavailable”:false,“ignoreCurrentStateUnknown”:true,“ignoreCurrentStateUnavailable”:true,“outputProperties”:[{“property”:“payload”,“propertyType”:“msg”,“value”:“”,“valueType”:“entityState”},{“property”:“data”,“propertyType”:“msg”,“value”:“”,“valueType”:“eventData”},{“property”:“topic”,“propertyType”:“msg”,“value”:“”,“valueType”:“triggerId”}],“x”:100,“y”:380,“wires”:[[“d2be1c8798d6a94b”]]},{“id”:“d2be1c8798d6a94b”,“type”:“switch”,“z”:“03a07ff174a11e10”,“name”:“Switch couleur”,“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“TEMPO_BLEU”,“vt”:“str”},{“t”:“eq”,“v”:“TEMPO_BLANC”,“vt”:“str”},{“t”:“eq”,“v”:“TEMPO_ROUGE”,“vt”:“str”},{“t”:“eq”,“v”:“NON_DEFINI”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:4,“x”:300,“y”:380,“wires”:[[“882ac79a448c3ff5”],[“b1968273fe677df9”],[“a4b2ed6b59606436”],]},{“id”:“42ee5f18d203323f”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“Grid Charge ON”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:false,“domain”:“switch”,“service”:“turn_on”,“areaId”:,“deviceId”:[“4f1c2381da520ac3261aed46ff17811b”],“entityId”:[“switch.battery_charge_from_grid”],“data”:“”,“dataType”:“jsonata”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:660,“y”:700,“wires”:[]},{“id”:“59e063edbec6a8aa”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“Grid charge OFF”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:false,“domain”:“switch”,“service”:“turn_off”,“areaId”:,“deviceId”:[“4f1c2381da520ac3261aed46ff17811b”],“entityId”:[“switch.battery_charge_from_grid”],“data”:“”,“dataType”:“jsonata”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:690,“y”:200,“wires”:[]},{“id”:“3a784d3913969b27”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“Excess to grid”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:false,“domain”:“select”,“service”:“select_first”,“areaId”:,“deviceId”:[“4f1c2381da520ac3261aed46ff17811b”],“entityId”:[“select.battery_excess_pv_energy_use_in_tou”],“data”:“”,“dataType”:“jsonata”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:140,“y”:760,“wires”:[]},{“id”:“54967e49970c5254”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“Excess to battery”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:false,“domain”:“select”,“service”:“select_last”,“areaId”:,“deviceId”:[“4f1c2381da520ac3261aed46ff17811b”],“entityId”:[“select.battery_excess_pv_energy_use_in_tou”],“data”:“”,“dataType”:“jsonata”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:690,“y”:480,“wires”:[]},{“id”:“340bcd57b44313a7”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“Excess to battery”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:false,“domain”:“select”,“service”:“select_last”,“areaId”:,“deviceId”:[“4f1c2381da520ac3261aed46ff17811b”],“entityId”:[“select.battery_excess_pv_energy_use_in_tou”],“data”:“”,“dataType”:“jsonata”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:670,“y”:740,“wires”:[]},{“id”:“0b3b7c7bb9e157f9”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“Grid charge OFF”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:false,“domain”:“switch”,“service”:“turn_off”,“areaId”:,“deviceId”:[“4f1c2381da520ac3261aed46ff17811b”],“entityId”:[“switch.battery_charge_from_grid”],“data”:“”,“dataType”:“jsonata”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:690,“y”:440,“wires”:[]},{“id”:“55c23718a29ab2de”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“Discharge to 20%”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:false,“domain”:“number”,“service”:“set_value”,“areaId”:,“deviceId”:[“4f1c2381da520ac3261aed46ff17811b”],“entityId”:[“number.battery_end_of_discharge_soc”],“data”:“{"value":20}”,“dataType”:“json”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:690,“y”:160,“wires”:[]},{“id”:“d8e78b5a0ef6c091”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“Discharge to 1%”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:false,“domain”:“number”,“service”:“set_value”,“areaId”:,“deviceId”:[“4f1c2381da520ac3261aed46ff17811b”],“entityId”:[“number.battery_end_of_discharge_soc”],“data”:“{"value":1}”,“dataType”:“json”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:660,“y”:660,“wires”:[]},{“id”:“f57219c2d1cbfe93”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“Discharge to 5%”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:false,“domain”:“number”,“service”:“set_value”,“areaId”:,“deviceId”:[“4f1c2381da520ac3261aed46ff17811b”],“entityId”:[“number.battery_end_of_discharge_soc”],“data”:“{"value":5}”,“dataType”:“json”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:680,“y”:400,“wires”:[]},{“id”:“882ac79a448c3ff5”,“type”:“ha-wait-until”,“z”:“03a07ff174a11e10”,“name”:“wait for 22:00”,“server”:“e187081d.522548”,“version”:2,“outputs”:1,“entityId”:“sensor.time”,“entityIdFilterType”:“exact”,“property”:“state”,“comparator”:“is”,“value”:“22:00”,“valueType”:“str”,“timeout”:“0”,“timeoutType”:“num”,“timeoutUnits”:“seconds”,“checkCurrentState”:true,“blockInputOverrides”:true,“outputProperties”:,“entityLocation”:“data”,“entityLocationType”:“none”,“x”:480,“y”:160,“wires”:[[“ada168bcc41d49bc”,“d90437b55e1ea821”,“55c23718a29ab2de”,“59e063edbec6a8aa”,“2ca76e95e171f4aa”]]},{“id”:“d90437b55e1ea821”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“Charge to 90%”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:false,“domain”:“number”,“service”:“set_value”,“areaId”:,“deviceId”:[“4f1c2381da520ac3261aed46ff17811b”],“entityId”:[“number.battery_end_of_charge_soc”],“data”:“{"value":90}”,“dataType”:“json”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:680,“y”:120,“wires”:[]},{“id”:“91ecc05810b31259”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“Charge to 100%”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:false,“domain”:“number”,“service”:“set_value”,“areaId”:,“deviceId”:[“4f1c2381da520ac3261aed46ff17811b”],“entityId”:[“number.battery_end_of_charge_soc”],“data”:“{"value":100}”,“dataType”:“json”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:680,“y”:360,“wires”:[]},{“id”:“a74bcd534039c830”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“Charge to 100%”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:false,“domain”:“number”,“service”:“set_value”,“areaId”:,“deviceId”:[“4f1c2381da520ac3261aed46ff17811b”],“entityId”:[“number.battery_end_of_charge_soc”],“data”:“{"value":100}”,“dataType”:“json”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:660,“y”:620,“wires”:[]},{“id”:“ada168bcc41d49bc”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“TOU 15:00 15:10”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:true,“domain”:“huawei_solar”,“service”:“set_tou_periods”,“areaId”:,“deviceId”:,“entityId”:,“data”:“{"periods":"15:00-15:10/1234567/-","device_id":"4f1c2381da520ac3261aed46ff17811b"}”,“dataType”:“json”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:690,“y”:80,“wires”:[]},{“id”:“3804d5ad11caf485”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“TOU 6:00 22:00 -”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:true,“domain”:“huawei_solar”,“service”:“set_tou_periods”,“areaId”:,“deviceId”:,“entityId”:,“data”:“{"periods":"06:00-22:00/1234567/-","device_id":"4f1c2381da520ac3261aed46ff17811b"}”,“dataType”:“json”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:690,“y”:320,“wires”:[]},{“id”:“55a58c8d31e48a14”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“TOU 6:00 22:00 - 00:00 4:30 +”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:true,“domain”:“huawei_solar”,“service”:“set_tou_periods”,“areaId”:,“deviceId”:,“entityId”:,“data”:“{"periods":"06:00-22:00/1234567/-\n00:00-04:30/1234567/+","device_id":"4f1c2381da520ac3261aed46ff17811b"}”,“dataType”:“json”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:710,“y”:580,“wires”:[]},{“id”:“8a27a414b21db6d6”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“TOU 3:00 23:59 -”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:true,“domain”:“huawei_solar”,“service”:“set_tou_periods”,“areaId”:,“deviceId”:,“entityId”:,“data”:“{"periods":"03:00-23:59/1234567/-","device_id":"4f1c2381da520ac3261aed46ff17811b"}”,“dataType”:“json”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:150,“y”:600,“wires”:[]},{“id”:“9c83f1ae804cdc5f”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“Grid charge OFF”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:false,“domain”:“switch”,“service”:“turn_off”,“areaId”:,“deviceId”:[“4f1c2381da520ac3261aed46ff17811b”],“entityId”:[“switch.battery_charge_from_grid”],“data”:“”,“dataType”:“jsonata”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:150,“y”:720,“wires”:[]},{“id”:“5a65fef314094541”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“Charge to 100%”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:false,“domain”:“number”,“service”:“set_value”,“areaId”:,“deviceId”:[“4f1c2381da520ac3261aed46ff17811b”],“entityId”:[“number.battery_end_of_charge_soc”],“data”:“{"value":100}”,“dataType”:“json”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:150,“y”:640,“wires”:[]},{“id”:“81b2dbbdaa1afc59”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“Discharge to 5%”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:false,“domain”:“number”,“service”:“set_value”,“areaId”:,“deviceId”:[“4f1c2381da520ac3261aed46ff17811b”],“entityId”:[“number.battery_end_of_discharge_soc”],“data”:“{"value":5}”,“dataType”:“json”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:150,“y”:680,“wires”:[]},{“id”:“c4252b1ed884d68b”,“type”:“comment”,“z”:“03a07ff174a11e10”,“name”:“Summer”,“info”:“”,“x”:120,“y”:540,“wires”:},{“id”:“e15c56ac6befa546”,“type”:“comment”,“z”:“03a07ff174a11e10”,“name”:“Winter”,“info”:“”,“x”:110,“y”:160,“wires”:},{“id”:“bbf94447df3444cc”,“type”:“comment”,“z”:“03a07ff174a11e10”,“name”:“Bleu”,“info”:“”,“x”:650,“y”:40,“wires”:},{“id”:“7241f9310589d0f6”,“type”:“comment”,“z”:“03a07ff174a11e10”,“name”:“Blanc”,“info”:“”,“x”:650,“y”:280,“wires”:},{“id”:“4614e832d5522516”,“type”:“comment”,“z”:“03a07ff174a11e10”,“name”:“Rouge”,“info”:“”,“x”:630,“y”:540,“wires”:},{“id”:“2ca76e95e171f4aa”,“type”:“api-call-service”,“z”:“03a07ff174a11e10”,“name”:“Excess to grid”,“server”:“e187081d.522548”,“version”:5,“debugenabled”:false,“domain”:“select”,“service”:“select_first”,“areaId”:,“deviceId”:[“4f1c2381da520ac3261aed46ff17811b”],“entityId”:[“select.battery_excess_pv_energy_use_in_tou”],“data”:“”,“dataType”:“jsonata”,“mergeContext”:“”,“mustacheAltTags”:false,“outputProperties”:,“queue”:“none”,“x”:680,“y”:240,“wires”:[]},{“id”:“b1968273fe677df9”,“type”:“ha-wait-until”,“z”:“03a07ff174a11e10”,“name”:“wait for 15:05”,“server”:“e187081d.522548”,“version”:2,“outputs”:1,“entityId”:“sensor.time”,“entityIdFilterType”:“exact”,“property”:“state”,“comparator”:“is”,“value”:“15:05”,“valueType”:“str”,“timeout”:“0”,“timeoutType”:“num”,“timeoutUnits”:“seconds”,“checkCurrentState”:true,“blockInputOverrides”:true,“outputProperties”:,“entityLocation”:“data”,“entityLocationType”:“none”,“x”:480,“y”:380,“wires”:[[“3804d5ad11caf485”,“91ecc05810b31259”,“f57219c2d1cbfe93”,“0b3b7c7bb9e157f9”,“54967e49970c5254”]]},{“id”:“a4b2ed6b59606436”,“type”:“ha-wait-until”,“z”:“03a07ff174a11e10”,“name”:“wait for 15:05”,“server”:“e187081d.522548”,“version”:2,“outputs”:1,“entityId”:“sensor.time”,“entityIdFilterType”:“exact”,“property”:“state”,“comparator”:“is”,“value”:“15:05”,“valueType”:“str”,“timeout”:“0”,“timeoutType”:“num”,“timeoutUnits”:“seconds”,“checkCurrentState”:true,“blockInputOverrides”:true,“outputProperties”:,“entityLocation”:“data”,“entityLocationType”:“none”,“x”:460,“y”:660,“wires”:[[“55a58c8d31e48a14”,“a74bcd534039c830”,“d8e78b5a0ef6c091”,“42ee5f18d203323f”,“340bcd57b44313a7”]]},{“id”:“e187081d.522548”,“type”:“server”,“name”:“Home Assistant”,“addon”:true}]
I have periods of the day where I get cheap electricity. These are defined dynamically (Intelligent Octopus tariff in the UK).
I’ve been able to set my fusionsolar battery to charge to 100% on the start event; but when it gets to 100% it then starts discharging.
Is there a way to suspect discharging the battery until it is re-activated? I can only see this in the TOU settings
The other alternative, I guess, is just to send the command to charge to 100% every 10 minutes or so but it seems a rather inefficient way!
Why not redefining TOU periods (look at John_Baxendale messages?)
Other idea: using “force charge” for the max possible duration of 24h (1440min), and stop it when your tariff changes? is 24h enough? you can probably reset force charge every 24h as long as tariff requires no discharge
Hello again everyone, I want to share my experience with Homeassistant and Huawei-Integration with two inverters (Master and Slave with Battery and Powermeter), which are both connected via internal wifi.
I am refreshing the inverters via automation.
History:
- Connected both inverters with the Dongle-Wifi (Port 502 - Slave-ID 1,2)–> >30s for refreshing rate
- Connected Master-Inverter via Internal wifi with my Intel NUC-Homeassistant -
Second inverter via Dongle-Wifi → ~20s refreshing rate but not synchronized - Today I tried to connect the Slave-Inverter via internal wifi with the
TP Link TL-WR802N → this worked after some adjustments:
I needed to change the IP of the inverter (old: 192.168.200.1) to the gateway of my router (new: 192.168.178.XXX) Howto: → Login via internal wifi → Fusion Solar App → Configure new device → Login (Installer - 00000000a) → Settings → Connections → Wifi → Expand → Change IP → save
After that I connected the TP Link WR802N with my router via LAN and logged in to the TP Link Wifi → Quick-Setup → Client Mode → Connect to the Inverter → Reboot → I needed to change gateway to my Router (LAN) → Tried to ping via Homeassistant 192.168.178.XXX → Success → Added the Integration (192.168.178.XXX - Port 6607 - Slave-ID 0 - elevated permissions) → Success
Now I have both inverters connected via internal wifi, without flashing the WR 802N with another firmware (open WRT or DD-WRT)
Unfortunately I have snow on my PV … no PV-Power as soon as possible I will have a look at the refreshing intervalls and if they are synchron.
Hopefully this will help others to integrate their two inverters as good as possible
Your saying you installed the sDongle in the Secondary Inverter and connected to that, and also connected via the inbuilt WiFi AP (used for commissioning) ?
In a cascade only one sDongle is to be utilised and it must be installed into the usb port of the Primary inverter. The Primary inverter then communicates to the Secondary inverter using the RS485 link. It’s modbus which works on a Master vs Slaves relationship, with the Primary Inverter being the master and the other inverter(s) and LUNA batteries being Slaves.
Connecting to the Inverter(s) - Look at what is termed “Option B” (connect to the sDongle that’s connected to your home LAN).
Cascaded Inverters
You are right, the dongle is connected to the master inverter, but for the second step I integrated only the slave inverter via dongle (connected to master) and the master inverter via internal wifi.
But this variant is pretty unstable that is why I tried to connect both inverters via internal wifi. And the guides helped a lot but left open many problems for me. The solution is, what i want to share! Many people here needed to flash the 802N with a new firmware … my solution works with original firmware and is pretty easy (if you know about the Gateway-problems)
Is it possible to get the current live solar generation value, as in what’s being generated at the moment and not the total so far in the day?
Look for Inverter Input power
Hi all,
I have a problem with the Huawei Solar integration and the HA version upgrades.
Every time I update the system, the integration stop to communicate with the inverter. I’ve reinstalled the integration without result. Usually it happens when I install a major version like 2023.12.0 from 2023.11.3. With the minor version upgrade, like from 2023.11.2 to 2023.11.3, all still remain working.
I’m using HA installed in a raspberry pi 3 and the communication with the interver is using Modbus TCP.
Someone could help me?
Thanks a lot