Hi community,
I’m new to HA and struggling with creating a sensor. I managed to publish energy data from the go-e controller via MQTT.
The MQTT Explorer shows the folliwing data in the topic of interest:
ccp = [2076.03,1107.613,null,null,968.4172,null,null,null,null,null,null,null,null,null,null,null]
I’ve managed to add a sensor via file editor (configuarion.yaml). The sensor shows all the data in that line.
I now struggle to seperate the three values and create three seperate sensor for it.
The “value_template” is not clear to me as the line shows pure data, not names (they are given in a seperate line)
Can someone help?
a link to a helpful discussion would be fine as well
Best,
Chris
If there’s someone reading with a similar problem, maybe using the same device (go-e controller):
The solution is writing
value_template: “{{ value_json.0 }}”
value_template: “{{ value_json.1 }}”
If there’s no topic name in the line included.
In detail I added to the configuration.yaml following:
mqtt:
sensor:
- name: “Grid”
state_topic: “ccp”
value_template: “{{ value_json.1 }}”
- name: “Solar”
state_topic: “ccp”
value_template: “{{ value_json.4 }}”
- name: “Home”
state_topic: “ccp”
value_template: “{{ value_json.0 }}”
The terms I used for describing might me wrong, the result is correct for me.
Hope I could help someone with that.
Best,
Chris
I´m currently struggeling with the integration of my go-e controller in homeassistant. Thanks to your posts I managed to integrate the power measurements as sensors using this template:
mqtt:
sensor:
- name: "go-e_Grid_Power"
state_topic: "go-eController/906xxx/ccp"
state_class: measurement
qos: 0
device_class: power
unit_of_measurement: "W"
value_template: '{{ value_json.1 }}'
- name: "go-e_Solar_Power"
state_topic: "go-eController/906xxx/ccp"
state_class: measurement
qos: 0
device_class: power
unit_of_measurement: "W"
value_template: '{{ value_json.4 }}'
- name: "go-e_Home_Power"
state_topic: "go-eController/906xxx/ccp"
state_class: measurement
qos: 0
device_class: power
unit_of_measurement: "W"
value_template: '{{ value_json.0 }}'
- name: "go-e_Car_Power"
state_topic: "go-eController/906xxx/ccp"
state_class: measurement
qos: 0
device_class: power
unit_of_measurement: "W"
value_template: '{{ value_json.2 }}'
But what does not work is the amount of energy.
I created the following template:
- name: "go-e_Grid_energy"
unique_id: "Test_Go-e_grid_energy"
state_topic: "go-eController/906xxx/cec"
state_class: total_increasing
qos: 0
device_class: energy
unit_of_measurement: "kWh"
last_reset_value_template: '1970-01-01T00:00:00+00:00'
value_template: '{{ value_json.1 |float(0) / 1000 }}'
- name: "go-e_Solar_energy"
state_topic: "go-eController/906xxx/cec"
state_class: total_increasing
qos: 0
device_class: energy
unit_of_measurement: "kWh"
value_template: '{{ value_json.4 |float(0) / 1000 }}'
- name: "go-e_Home_energy"
state_topic: "go-eController/906xxx/cec"
state_class: total_increasing
qos: 0
device_class: energy
unit_of_measurement: "kWh"
value_template: '{{ value_json.0 |float(0) / 1000 }}'
- name: "go-e_Car_energy"
state_topic: "go-eController/906xxx/cec"
state_class: total_increasing
qos: 0
device_class: energy
unit_of_measurement: "kWh"
value_template: '{{ value_json.2 |float(0) / 1000 }}'
and:
template:
- sensor:
- name: "Netzbezug in kWh"
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
state: "{{ states('sensor.go-e_Grid_energy')|float(0)}}"
availability: "{{ states('sensor.go-e_Grid_energy')|is_number }}"
icon: mdi:transmission-tower-export
- name: "Solarertrag in kWh"
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
state: "{{ states('go-e_Solar_energy')|float(0)}}"
availability: "{{ states('go-e_Solar_energy')|is_number }}"
icon: mdi:transmission-tower-export
- name: "Energieverbrauch in kWh"
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
state: "{{ states('go-e_Home_energy')|float(0)}}"
availability: "{{ states('go-e_Home_energy')|is_number }}"
icon: mdi:transmission-tower-export
- name: "Energieverbrauch E-Auto in kWh"
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
state: "{{ states('go-e_Car_energy')|float(0)}}"
availability: "{{ states('go-e_Car_energy')|is_number }}"
icon: mdi:transmission-tower-export
But I have barely an Idea what I’m doing here.
I also tested this go-e controller integration:
But unfortunately none of the entities created by the integration is avialable (doublechecked the base topic and serial number, but it does not work…
Any help is highly appreciated.
Kind regards,
Sebastian
Hi everyone,
I’m also very interested in integrating my goe-controller into Home Assistant, but to be honest, I have absolutely no idea how to do it. I’ve never added a sensor in Home Assistant without an existing integration before.
My goal is pretty simple: I’d like to see my solar production, how much power my house is currently consuming, and whether I’m feeding energy into the grid or drawing from it. Based on this data, I’d then like to create an automation.
If you could help me with the configuration, I would be incredibly grateful!
Thanks a lot in advance!
1 Like