Jump to content

ICC to Home Assistant integration


vlan_one

Recommended Posts

This is my first post on this forum and I thought it would be good to have a contribution as a first post and hope to help someone in future.

I have a 'big' deployment of Home Assistant running at home with all my lights, geyser and pool pump being controlled via Sonoffs with Tasmota Fw. Some of these devices are controlled via automation scripts to switch on the geyser at certain times or the lights when I get home after dark.

Now... with me getting into solar energy and buying a variant of the Axpert inverter it was a no brainer to look into ICC (although as I am writing this I am still on my 7 day trial). I installed it and had to get used to the interface. A few days in and I am liking it very much. I keep checking the dashboard for stats. Logging into VNC from my PC and phone is becoming tedious and I noticed that sometimes the ICC app hangs for a while. In order to make it easier I have checked with Manie about the MQTT capabilities and I have been able to successfully extract data from ICC.

At first I tried to push all the ICC data to my MQTT broker running on my Home Assistant instance, but for some reason it took a dive. I reverted the MQTT back to the local ICC broker. I then setup a MQTT bridge on my Home Assistant broker to only extract certain topics from ICC and then integrated this into my Energy page for quick viewing of my energy stats.

I had to connect to the ICC broker to scan for all the topics used by ICC. I did this with MQTT FX. I then setup the MQTT bridge as below:

Go to the HASS.io tab in Home Assistant, click on Mosquitto and change the config as below. Change customize > Active to true.

{
  "logins": [
    {
      "username": "xxxxxxxx",
      "password": "xxxxxxxx"
    }
  ],
  "anonymous": true,
  "customize": {
    "active": true,
    "folder": "mosquitto"
  },
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

Click save

SSH to HASS.io and log in.

cd ..
cd share
mkdir mosquito
cd mosquito
touch mosquitto.conf
nano mosquito.conf
add the following text:

#connection ICC
connection ICC
address xxx.xxx.xxx.xxx

topic <topic as scanned> in 0

Press Ctrl-X, type Y to save.

I subscribribed to the follwing as an initial test:
topic Inverter/Month_PV_Total in 0
topic Inverter/SolarKwUse in 0
topic Inverter/MaxPvDay in 0

Go to the HASS.io tab in Home Assistant, click on Mosquitto and click restart to restart the broker.

If all goes well, connecting to your Home Assistant broker and scanning for the topics should show the ICC topics your Home Assistant broker subscribed to. Just add these topics as sensors in your configuration.yaml file on Home Assistant adn you should be able to see the info.

Now I can use this data to use my Home Assistant to check the PV input and switch on the geyser or poolpump to burn the excess energy generated.

PS: I am enjoying all the wealth of info on this great site.

Edited by vlan_one
formatting line spacing
Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...
On 2019/06/13 at 2:47 PM, Durran said:

Hi VLAN_One, have you tried running Hass.io on the RPI which runs ICC?

Are you concerned about cpu load running both from one Pi? I'm gonna try this today, but I think icc is already quite cpu intensive so... we shall see!

Link to comment
Share on other sites

Turns out, CPU load is not the issue. Hass.io doesnt enjoy running on same box as ICC using an off the shelf installation (pretty much all Im capable of in Linux unfortunately)

What I noticed:

Having installed Configurator, I get a 403 Forbidden from nginx

Having installed Samba (an alternate way to configure/backup configs), the share doesnt appear on my LAN (10.0.0.0/8). The config I used for Samba was:

{
  "workgroup": "WORKGROUP",
  "username": "xxxxxx",
  "password": "xxxxxx",
  "interface": "wlan0",
  "allow_hosts": [
    "10.0.0.0/8",
    "172.16.0.0/12",
    "192.168.0.0/16"
  ]
}

I'd be really happy if someone who has managed to get these two to work on the same box as ICC could share :)

Link to comment
Share on other sites

9 hours ago, Jimbo said:

Having installed Samba (an alternate way to configure/backup configs), the share doesnt appear on my LAN (10.0.0.0/8). The config I used for Samba was:


{
  "workgroup": "WORKGROUP",
  "username": "xxxxxx",
  "password": "xxxxxx",
  "interface": "wlan0",
  "allow_hosts": [
    "10.0.0.0/8",
    "172.16.0.0/12",
    "192.168.0.0/16"
  ]
}

I

I managed to get Samba working on my ICC Pi using the instructions here: https://www.raspberrypi.org/documentation/remote-access/samba.md

Did you also include a folder on the Pi to share?  Something similar to this should do the trick:

[share]
    path = /home/pi/shared
    read only = no
    public = yes
    writable = yes
Link to comment
Share on other sites

  • 4 months later...
On 2019/04/20 at 11:13 PM, vlan_one said:

This is my first post on this forum and I thought it would be good to have a contribution as a first post and hope to help someone in future.

I have a 'big' deployment of Home Assistant running at home with all my lights, geyser and pool pump being controlled via Sonoffs with Tasmota Fw. Some of these devices are controlled via automation scripts to switch on the geyser at certain times or the lights when I get home after dark.

Now... with me getting into solar energy and buying a variant of the Axpert inverter it was a no brainer to look into ICC (although as I am writing this I am still on my 7 day trial). I installed it and had to get used to the interface. A few days in and I am liking it very much. I keep checking the dashboard for stats. Logging into VNC from my PC and phone is becoming tedious and I noticed that sometimes the ICC app hangs for a while. In order to make it easier I have checked with Manie about the MQTT capabilities and I have been able to successfully extract data from ICC.

At first I tried to push all the ICC data to my MQTT broker running on my Home Assistant instance, but for some reason it took a dive. I reverted the MQTT back to the local ICC broker. I then setup a MQTT bridge on my Home Assistant broker to only extract certain topics from ICC and then integrated this into my Energy page for quick viewing of my energy stats.

I had to connect to the ICC broker to scan for all the topics used by ICC. I did this with MQTT FX. I then setup the MQTT bridge as below:

Go to the HASS.io tab in Home Assistant, click on Mosquitto and change the config as below. Change customize > Active to true.

{
  "logins": [
    {
      "username": "xxxxxxxx",
      "password": "xxxxxxxx"
    }
  ],
  "anonymous": true,
  "customize": {
    "active": true,
    "folder": "mosquitto"
  },
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

Click save

SSH to HASS.io and log in.

cd ..
cd share
mkdir mosquito
cd mosquito
touch mosquitto.conf
nano mosquito.conf
add the following text:

#connection ICC
connection ICC
address xxx.xxx.xxx.xxx

topic <topic as scanned> in 0

Press Ctrl-X, type Y to save.

I subscribribed to the follwing as an initial test:
topic Inverter/Month_PV_Total in 0
topic Inverter/SolarKwUse in 0
topic Inverter/MaxPvDay in 0

Go to the HASS.io tab in Home Assistant, click on Mosquitto and click restart to restart the broker.

If all goes well, connecting to your Home Assistant broker and scanning for the topics should show the ICC topics your Home Assistant broker subscribed to. Just add these topics as sensors in your configuration.yaml file on Home Assistant adn you should be able to see the info.

Now I can use this data to use my Home Assistant to check the PV input and switch on the geyser or poolpump to burn the excess energy generated.

PS: I am enjoying all the wealth of info on this great site.

Hi there vlan_one, what username and password did you use here? is it the ICC username/password? TIA.

Link to comment
Share on other sites

17 minutes ago, Durran said:

Yup, I tried this yesterday and works well. its the ICC username and password

Thanks for your response. I tried the above, and I don't seem to be connecting to ICC. See my logs below.

 

Log
[12:42:31] INFO: Setup mosquitto configuration
[12:42:31] WARNING: SSL not enabled - No valid certs found!
[12:42:31] INFO: Found local users inside config
[12:42:32] INFO: Initialize Hass.io Add-on services
[12:42:32] INFO: Initialize Home Assistant discovery
[12:42:32] INFO: Start Mosquitto daemon
1581072152: Loading config file /share/mosquitto/mosquitto.conf
1581072152: mosquitto version 1.6.3 starting
1581072152: Config loaded from /etc/mosquitto.conf.
1581072152: Loading plugin: /usr/share/mosquitto/auth-plug.so
1581072152: |-- *** auth-plug: startup
1581072152:  ├── Username/password checking enabled.
1581072152:  ├── TLS-PSK checking enabled.
1581072152:  └── Extended authentication not enabled.
1581072152: Opening ipv4 listen socket on port 1883.
1581072152: Opening ipv6 listen socket on port 1883.
1581072152: Opening websockets listen socket on port 1884.
1581072152: Warning: Mosquitto should not be run as root/administrator.
1581072152: Connecting bridge ICC (192.168.88.43:1883)
Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...
  • 1 year later...
On 2019/04/21 at 12:13 AM, vlan_one said:

At first I tried to push all the ICC data to my MQTT broker running on my Home Assistant instance, but for some reason it took a dive. I reverted the MQTT back to the local ICC broker. I then setup a MQTT bridge on my Home Assistant broker to only extract certain topics from ICC and then integrated this into my Energy page for quick viewing of my energy stats.

I had to connect to the ICC broker to scan for all the topics used by ICC. I did this with MQTT FX. I then setup the MQTT bridge as below:

Go to the HASS.io tab in Home Assistant, click on Mosquitto and change the config as below. Change customize > Active to true.

{
  "logins": [
    {
      "username": "xxxxxxxx",
      "password": "xxxxxxxx"
    }
  ],
  "anonymous": true,
  "customize": {
    "active": true,
    "folder": "mosquitto"
  },
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

Click save

SSH to HASS.io and log in.

c

If all goes well, connecting to your Home Assistant broker and scanning for the topics should show the ICC topics your Home Assistant broker subscribed to. Just add these topics as sensors in your configuration.yaml file on Home Assistant adn you should be able to see the info.

 

Hi Vlan_one.

I am trying to connect Home assistant to ICC and saw this old post of yours. Would it still work with the newer version of HassIO.  

I have configured the Mosquitto config file as per your notes above but cannot see any of the ICC topics in Home Assistant. Have also tried adding following to configuration.yaml file with no success.

sensor:
  - platform: mqtt
    name: "Mecer"
    state_topic: "Inverter/LoadWatts"
    unit_of_measurement: "W"
    unique_id: "MecerLoad"
    value_template: "{{ value_json.Inverter }}"
    availability:
      - topic: "Inverter/LoadWatts"
    payload_available: "online"
    payload_not_available: "offline"
    #json_attributes_topic: "home/sensor1/attributes"  

 

ANy help will be greatly appreciated. I basically would like to read values from ICC like solar power available and current load to switch certain loads on/off.

Regards Vijen

Link to comment
Share on other sites

19 hours ago, Vijen said:

Hi Vlan_one.

I am trying to connect Home assistant to ICC and saw this old post of yours. Would it still work with the newer version of HassIO.  

I have configured the Mosquitto config file as per your notes above but cannot see any of the ICC topics in Home Assistant. Have also tried adding following to configuration.yaml file with no success.

sensor:
  - platform: mqtt
    name: "Mecer"
    state_topic: "Inverter/LoadWatts"
    unit_of_measurement: "W"
    unique_id: "MecerLoad"
    value_template: "{{ value_json.Inverter }}"
    availability:
      - topic: "Inverter/LoadWatts"
    payload_available: "online"
    payload_not_available: "offline"
    #json_attributes_topic: "home/sensor1/attributes"  

 

ANy help will be greatly appreciated. I basically would like to read values from ICC like solar power available and current load to switch certain loads on/off.

Regards Vijen

Hi Vijen,

 

I tested the method by Vijen, and it works well. Before I couldn't get it to work and resorted to using the emoncms intergration for home Assistant.  I believe the issue is with the way you are adding the sensors.

 

This works:

sensor:
  - platform: mqtt
    name: "Mecer"
    state_topic: "Inverter/LoadWatts"
    unit_of_measurement: "W"

 

This does not work:

sensor:
  - platform: mqtt
    name: "Mecer"
    state_topic: "Inverter/LoadWatts"
    unit_of_measurement: "W"
    unique_id: "MecerLoad"
    value_template: "{{ value_json.Inverter }}"
    availability:
      - topic: "Inverter/LoadWatts"
    payload_available: "online"
    payload_not_available: "offline"
    #json_attributes_topic: "home/sensor1/attributes"  

Link to comment
Share on other sites

Thanks, will try it as soon as I get home. Did you add anything else to configuration.yaml file for MQQT to work or is it just the standard setup on the Mqqt integration package with address, username, password and port?

Link to comment
Share on other sites

Thanks Lord Buckethead,

Simplifying the config file as per your recommendation worked. I am not sure if I am doing it correctly however as when I add a 2nd sensor for the inverter the 1st one stops working. My config file extract is below:

sensor:
  - platform: mqtt
    name: "MecerLoad"
    state_topic: "Inverter/LoadWatts"
    unit_of_measurement: "W"
    name: "SOC"
    state_topic: "Inverter/BatterySOC"
    unit_of_measurement: "%"

How do you add a list of sensors eg Loadwatts, PV Power, SOC to the config file so that you can access more information?

 

Regards Vijen

Link to comment
Share on other sites

54 minutes ago, Vijen said:

Thanks Lord Buckethead,

Simplifying the config file as per your recommendation worked. I am not sure if I am doing it correctly however as when I add a 2nd sensor for the inverter the 1st one stops working. My config file extract is below:

sensor:
  - platform: mqtt
    name: "MecerLoad"
    state_topic: "Inverter/LoadWatts"
    unit_of_measurement: "W"
    name: "SOC"
    state_topic: "Inverter/BatterySOC"
    unit_of_measurement: "%"

How do you add a list of sensors eg Loadwatts, PV Power, SOC to the config file so that you can access more information?

 

Regards Vijen

Glad to know it worked for you. You have to create a new sensor for each topic. See an example config below:

 

  - platform: mqtt
    name: "pylontech SOC"
    state_topic: "Inverter/BatterySOC"
    unit_of_measurement: "%"
    
  - platform: mqtt
    name: "Solar Month Total Cost"
    state_topic: "Inverter/Month_TotalCost"
    unit_of_measurement: "ZAR"    

  - platform: mqtt
    name: "Solar Month Cost Savings"
    state_topic: "Inverter/Month_Cost_Saving"
    unit_of_measurement: "ZAR"    
    
  - platform: mqtt
    name: "Inverter Mode"
    state_topic: "Inverter/InverterMode"

 

Let me know how it goes.

Link to comment
Share on other sites

Hi Lord Buckethead, the above works great, thx.

I just find the configuration file is super sensitive because now I cannot read the sonoff devices anymore. I must have typed a space somewhere that is stuffing up the config file.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...