JacquesV Posted February 16, 2023 Share Posted February 16, 2023 Good day all. Is there anybody running Home Assistant and ICC Solar with MQTT integration? I looked through the older posts, but I can not get the MQTT "connection" to work. I have managed to get a Tesla Style Power card to work with the Local EMONCMS values from the ICC PI. Home Assistant is running on a VM, the ICC PI only runs the Programs installed by the ICC image. Any pointers and or guide will be much appreciated. Quote Link to comment Share on other sites More sharing options...
mzezman Posted February 17, 2023 Share Posted February 17, 2023 I have no experience with ICC but do you have the MQTT fundamentals working 100% on HA? Is the broker up and running? What topics is the broker listening for from ICC? Can you see the ICC device / topic in the HA MQTT broker? Quote Link to comment Share on other sites More sharing options...
JacquesV Posted February 17, 2023 Author Share Posted February 17, 2023 Thank you for the attempting to assist, I will try to answer with as much detail as possible. I have the Mosquito broker configured to use the ICC PI MQTT built in broker, so the broker* is set to the PI (static)IP address, and port, username and password, as per the ICC MQTT port, username and password as displayed in ICC Solar settings tab. It does seem to connect, I do not get any errors. But that is up to where I manage to get. I do not get any "Topics" when "Listening" while Subscribing to topics and publishing payloads does not change anything as expected to. Still no errors up to this point, but no reaction as well. I might be missing something simple... Quote Link to comment Share on other sites More sharing options...
mzezman Posted February 17, 2023 Share Posted February 17, 2023 Oh ok - i am using the HomeAssistant Mosquitto as the broker - this then listens out for other client MQTT topics, So in HomeAssistant i see all my MQTT clients Would you be able to try setting up the broker on HomeAssistant? Quote Link to comment Share on other sites More sharing options...
JacquesV Posted February 18, 2023 Author Share Posted February 18, 2023 Will try to remove mosquitto and set up new broker and then try to listen to ICC mqtt broker. Quote Link to comment Share on other sites More sharing options...
JacquesV Posted February 20, 2023 Author Share Posted February 20, 2023 I have set up Home Assistant MQTT Broker as "core broker" but it still does not receive any published data from ICC MQTT broker. Using MQTT explorer I can only receive data on $SYS/#" which suggest to me that the ICC Broker is running, but no other data (such as "Inverter/LoadWatts, ect.") is being published by the ICC broker. This then seems to be a problem I need to solve within the ICC PI system, of which I definitely don't have the necessary knowledge to do on my own. If only Solar Assistant had Static IP available yet if would have been an easy switch to make Thank you very much for the assistance to far. Quote Link to comment Share on other sites More sharing options...
edgarl Posted March 17, 2023 Share Posted March 17, 2023 I have run ICC successfully with HA. I use the built-in/add-on Mosquitto broker in HA. To get ICC to communicate with the HA Mosquitto broker, you need to create a config file called icc.conf in /share/mosquitto folder on your HA server. The icc.conf file need to contain the following: connection ICM remote_username ICM remote_password ICM123456 address <IP of your ICM PI:Port> topic inverter/# out The way I created/edited this file, is by using the HA community add-on SSH&Web Terminal https://github.com/hassio-addons/addon-ssh to access the share folder. I then created the mosquitto folder and then the icc.conf file using nano editor. Once the icc.conf file has been created, you need to restart your Mosquitto broker and then check the broker log to see that it finds the icc.conf file. I do these two steps by going to the Mosquitto broker page in the Settings/Add-ons menu in HA. Refresh the log a few times while the broker is restarting to see the connection to ICM. Hope this helps. Let me know Quote Link to comment Share on other sites More sharing options...
Edl Posted March 17, 2023 Share Posted March 17, 2023 And I see that I had to create sensors in my configuration.yaml for the mqtt info I wanted to display in my HA front-end: mqtt: sensor: - name: "Solar_SOC" state_topic: "ICC-Master/Battery/SOC" - name: "Solar_Battery_Amps" state_topic: "ICC-Master/Battery/Amps" - name: "Solar_Load_Watts" state_topic: "ICC-Master/Inverter/TotalLoadWatts" - name: "Solar_Grid_Watts" state_topic: "ICC-Master/Inverter/TotalGridWatts" - name: "Solar_PV_Watts" state_topic: "ICC-Master/Inverter/PvWattsTotal" - name: "Solar_energy_Kwh_Today" state_topic: "ICC-Master/Inverter/SolarKWhUse" - name: "Solar_Battery_Time_Remaining" state_topic: "ICC-Master/Battery/TimeRemaining" Quote Link to comment Share on other sites More sharing options...
uDuWaR Posted March 28, 2023 Share Posted March 28, 2023 (edited) On 2023/03/17 at 9:03 AM, edgarl said: I have run ICC successfully with HA. I use the built-in/add-on Mosquitto broker in HA. To get ICC to communicate with the HA Mosquitto broker, you need to create a config file called icc.conf in /share/mosquitto folder on your HA server. The icc.conf file need to contain the following: connection ICM remote_username ICM remote_password ICM123456 address <IP of your ICM PI:Port> topic inverter/# out The way I created/edited this file, is by using the HA community add-on SSH&Web Terminal https://github.com/hassio-addons/addon-ssh to access the share folder. I then created the mosquitto folder and then the icc.conf file using nano editor. Once the icc.conf file has been created, you need to restart your Mosquitto broker and then check the broker log to see that it finds the icc.conf file. I do these two steps by going to the Mosquitto broker page in the Settings/Add-ons menu in HA. Refresh the log a few times while the broker is restarting to see the connection to ICM. Hope this helps. Let me know Hi @edgarl, Thank you so much for the above. I have followed the instructions and finally managed to get the Mosquitto broker to connect to the ICM PI. I see the below message in the log: [09:43:10] INFO: Starting mosquitto MQTT broker... 1679989390: Loading config file /share/mosquitto/icc.conf 2023-03-28 09:43:10: Warning: Mosquitto should not be run as root/administrator. [09:43:10] INFO: Successfully send discovery information to Home Assistant. [09:43:10] INFO: Successfully send service information to the Supervisor. My question is where does it store the topic inverter/# out metrics so I can use them in scenes and automation? Edited March 28, 2023 by uDuWaR Tag User Quote Link to comment Share on other sites More sharing options...
uDuWaR Posted March 28, 2023 Share Posted March 28, 2023 Hi @JacquesV and the other chaps I managed to get it working, little blood, some sweat and way too many tears The 1st thing you need to do is make sure you can connect to the MQTT broker on the ICM PI. Download MQTT explorer and connect default password is ICM123456. You should see the ICM-Master on the broker with all your info. Then you need to create the integration on the HA -> Settings -> Devices & Services -> Add Integration -> MQTT default and add the PI's details. Finally you need to add the sensors using the same config that @Edl supplied. You do this by going to Settings -> Add-ons -> Download and install File Editor. Open File editor then open the config/configuration.yaml then add the sensors he posted above. I am certain you can add some kind of auto discovery. Here is the documentation I suspect you need. https://www.home-assistant.io/integrations/mqtt/#mqtt-discovery Finally give everything a restart. Under Settings -> Devices & Services -> Entities search for solar and you should see them. Now you should be able to add them as Cards on your dashboard. Quote Link to comment Share on other sites More sharing options...
uDuWaR Posted March 31, 2023 Share Posted March 31, 2023 Little update: I have managed to tag the data sources correctly so you can configure the energy dashboard in HA. Take the watt used value from the sonoff geyser switch and calculate a kWh usage Finally convert the negative number received from the ICM PI for battery used to a positive so it can be used in the Energy display. # To calculate the kWh for various watt metrics sensor: - platform: integration source: sensor.sonoff_10014e384f_power name: Geyser_energy_used unit_prefix: k round: 2 - platform: integration source: sensor.solar_grid_watts name: Grid_watts_calculated unit_prefix: k round: 2 # Convert the negative number of battery used to a positive template: - sensor: - name: "Solar_Month_BatteryKWh_Used_Positive" unit_of_measurement: "kWh" state_class: total_increasing device_class: energy state: > {% if states('sensor.Solar_Month_BatteryKWh_Used') | float(0) <= 0 %} {% set gridout = (states('sensor.Solar_Month_BatteryKWh_Used') |float |abs) %} {% else %} {% set gridout = 0 %} {% endif %} {{ gridout }} # MQTT details to pull information from the ICM PI mqtt: sensor: - name: "Solar_SOC" state_topic: "ICC-Master/Battery/SOC" unit_of_measurement: "%" state_class: "measurement" device_class: "battery" - name: "Solar_Battery_Amps" state_topic: "ICC-Master/Battery/Amps" unit_of_measurement: "A" state_class: "measurement" device_class: "current" - name: "Solar_Load_Watts" state_topic: "ICC-Master/Inverter/TotalLoadWatts" unit_of_measurement: "W" state_class: "measurement" device_class: "power" - name: "Solar_Grid_Watts" state_topic: "ICC-Master/Inverter/TotalGridWatts" unit_of_measurement: "W" state_class: "measurement" device_class: "power" - name: "Solar_Battery_Time_Remaining" state_topic: "ICC-Master/Battery/TimeRemaining" unit_of_measurement: hh:mm - name: "Solar_Month_Grid_Total" state_topic: "ICC-Master/Inverter/Month_Grid_Total" unit_of_measurement: "kWh" state_class: "total_increasing" device_class: "energy" - name: "Solar_Month_Load_Total" state_topic: "ICC-Master/Inverter/Month_Total_Use" unit_of_measurement: "kWh" state_class: "total_increasing" device_class: "energy" - name: "Solar_Month_BatteryKWh_Used" state_topic: "ICC-Master/Inverter/Month_BatteryKWh_Used" unit_of_measurement: "kWh" state_class: "total_increasing" device_class: "energy" - name: "Solar_Month_BatteryKWh_Charged" state_topic: "ICC-Master/Inverter/Month_BatteryKWh_Charged" unit_of_measurement: "kWh" state_class: "total_increasing" device_class: "energy" Dashboard looks like this now: Quote Link to comment Share on other sites More sharing options...
JacquesV Posted April 4, 2023 Author Share Posted April 4, 2023 Thanx a mil. Will try to get it running as soon as I have a bit of time. Quote Link to comment Share on other sites More sharing options...
Schnavel Posted June 22, 2023 Share Posted June 22, 2023 Thanks for the great post guys - I have just installed HA and I'm in the process of setting up all of my sensors and dashboards. I'm still new when it comes to programming on the .yaml configuration, but for the life of me, I cannot seem to be able to get the values for the amount of PV produced. I'm using the following: - name: "Solar_PV_Watts" state_topic: "ICC-Master/Inverter/TotalPVWatts" unit_of_measurement: "W" state_class: "measurement" device_class: "power" This seems to fall in-line with what @uDuWaR so kindly posted. However, I have been unable to get it to work. When I review the entity, it just states that there is no information available. I have managed to get all of the other variables to work, but stuck on this one. Quote Link to comment Share on other sites More sharing options...
uDuWaR Posted June 22, 2023 Share Posted June 22, 2023 (edited) Hi Schnavel There is no value called TotalPVWatts I used: ICC-Master/Inverter1/MPPT1_Watts Edited June 22, 2023 by uDuWaR Oops misread the above message Schnavel 1 Quote Link to comment Share on other sites More sharing options...
Schnavel Posted June 22, 2023 Share Posted June 22, 2023 Thanks @uDuWaR, but my inverter has 2x MPPT inputs. Looking at you original post, I managed to figure out the problem. The correct line is PvWattsTotal (the small v was causing an issue). I just edited my .yaml config and it is up and running. Quote Link to comment Share on other sites More sharing options...
uDuWaR Posted June 22, 2023 Share Posted June 22, 2023 Ah yes now I see it, all good! Quote Link to comment Share on other sites More sharing options...
uDuWaR Posted June 22, 2023 Share Posted June 22, 2023 Fyi, I have managed to build quite a nice front end layout using the sunsync interface that @slipx on this forum setup: Details on this post Schnavel 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.