I am currently working on configuring this at my end and shifting away from the DCC integration.
Jane replied to one of my emails this morning and announced the new feature officially as I have seen it on the device yesterday. Thank you Jane for being awesome!
Will come back and update this post when I have news (and post as well)
UPDATE 19 JAN
Updated the power entity to skip any negative values. Some meters are randomly doing negative spikes which can also be seen on the Bright app.
UPDATE 17 OCT
Removed Smart Meter Gas: Power
entity as the data is not available in the MQTT feed anymore. Jane mentioned it at some point in the past (can’t remember the source) that power is irrelevant in the context of gas and will be removed at some point. This is not present anymore. You will need to manually delete this entity once you remove it from your config and reload/restart
UPDATE 15 JUN
Renamed unique_id for smart_meter_electricity_import_day
and smart_meter_gas_import_day
to _today
. This is a breaking change and will need some manual cleanup. You will need to search for the old entity and delete it. And you will need to edit the new entity and remove _2
from the ID. Because the unique_id has changed this created a new entity altogether.
Also, I have updated the templates for Electricity Import (Today) and Gas Import (Today). This is because in some cases the meter would report a value of 0. This will then reset the cost, and in some cases it could happen at a bad time of the day and mess up the costs in the Energy dashboard. The new template will check if the value is 0 and the current time is past 00:01, and use previous value, otherwise just use the new value.
UPDATE 10 Jun 23PM
Undone this for now, will check tomorrow with a fresh pair of eyes
Updated the entities smart_meter_electricity_import
and smart_meter_gas_import
again comparing them to previous value. If they are less, the value is skipped. This is in an attempt to avoid issues with Energy dashboard counting much more used energy than in reality.
Note: If for any reason your meter reports a big increase at random, this change will not update your entities even if the new value (lower) is actually correct. If your meter has this behaviour, change the template to == 0
instead of < entity
UPDATE 10 Jun
No code changes. Just added some Bonus Content at the end of this post with my Lovelace setup for Energy monitoring.
UPDATE 8 Jun 14PM
Updated the device_class
of smart_meter_electricity_power
and smart_meter_gas_power
as I have erroneously set it to energy
instead of power
UPDATE 8 Jun 12PM
Updated the entities smart_meter_electricity_import
and smart_meter_gas_import
in order to overcome 0
values. Yesterday the mqtt feed received a value of 0 twice in a row from the Gas Import which basically added aprox 35,000kwh on my gas consumption for that 30 min interval in the Energy dashboard. That is because my current meter reading is a bit over 17,000.
To avoid, i have templated the value to be the previous one only if the received value is 0. So the entity will be stagnant rather than reset.
UPDATE 7 Jun 14:30PM
Updated Gas icons to fire. I forgot to change them when duplicating from Electricity
UPDATE 7 Jun 14PM
I have removed the word Energy from the entities names and ids. The below has been updated so just follow the instructions. If you have set it up before this update, and you decide to update too, make sure to remove the old entities and update your energy configuration.
INSTRUCTIONS
Start by setting up your MQTT details on the IHD (there is no need for Hildebrand to enable MQTT at their end). My software version is v1.8.12. As this is a new feature, I would expect that some of you might not see the configuration until the device updates. The settings steps can be seen in the video on this article Glow — Local MQTT. Here at last … free upgrade in version… | by Joshua Cooper | Medium
Create the following entities in Home Assistant. Please make sure to use the correct device ID and replace the word REDACTED with it. The ID is the device MAC without the colons, can be found either on the IHD or on the Bright app under Devices.
mqtt:
sensor:
- name: "Smart Meter Electricity: Export"
unique_id: "smart_meter_electricity_export"
state_topic: "glow/REDACTED/SENSOR/electricitymeter"
device_class: "energy"
unit_of_measurement: "kWh"
state_class: "total_increasing"
value_template: "{{ value_json['electricitymeter']['energy']['export']['cumulative'] }}"
icon: "mdi:flash"
- name: "Smart Meter Electricity: Import"
unique_id: "smart_meter_electricity_import"
state_topic: "glow/REDACTED/SENSOR/electricitymeter"
device_class: "energy"
unit_of_measurement: "kWh"
state_class: "total_increasing"
value_template: >
{% if value_json['electricitymeter']['energy']['import']['cumulative'] == 0 %}
{{ states('sensor.smart_meter_electricity_import') }}
{% else %}
{{ value_json['electricitymeter']['energy']['import']['cumulative'] }}
{% endif %}
icon: "mdi:flash"
- name: "Smart Meter Electricity: Import (Today)"
unique_id: "smart_meter_electricity_import_today"
state_topic: "glow/REDACTED/SENSOR/electricitymeter"
device_class: "energy"
unit_of_measurement: "kWh"
state_class: "measurement"
value_template: >
{% if value_json['electricitymeter']['energy']['import']['day'] == 0
and now() > now().replace(hour=0).replace(minute=1).replace(second=0).replace(microsecond=0) %}
{{ states('sensor.smart_meter_electricity_import_today') }}
{% else %}
{{ value_json['electricitymeter']['energy']['import']['day'] }}
{% endif %}
icon: "mdi:flash"
- name: "Smart Meter Electricity: Import (This week)"
unique_id: "smart_meter_electricity_import_week"
state_topic: "glow/REDACTED/SENSOR/electricitymeter"
device_class: "energy"
unit_of_measurement: "kWh"
state_class: "measurement"
value_template: "{{ value_json['electricitymeter']['energy']['import']['week'] }}"
icon: "mdi:flash"
- name: "Smart Meter Electricity: Import (This month)"
unique_id: "smart_meter_electricity_import_month"
state_topic: "glow/REDACTED/SENSOR/electricitymeter"
device_class: "energy"
unit_of_measurement: "kWh"
state_class: "measurement"
value_template: "{{ value_json['electricitymeter']['energy']['import']['month'] }}"
icon: "mdi:flash"
- name: "Smart Meter Electricity: Import Unit Rate"
unique_id: "smart_meter_electricity_import_unit_rate"
state_topic: "glow/REDACTED/SENSOR/electricitymeter"
device_class: "monetary"
unit_of_measurement: "GBP/kWh"
state_class: "measurement"
value_template: "{{ value_json['electricitymeter']['energy']['import']['price']['unitrate'] }}"
icon: "mdi:cash"
- name: "Smart Meter Electricity: Import Standing Charge"
unique_id: "smart_meter_electricity_import_standing_charge"
state_topic: "glow/REDACTED/SENSOR/electricitymeter"
device_class: "monetary"
unit_of_measurement: "GBP"
state_class: "measurement"
value_template: "{{ value_json['electricitymeter']['energy']['import']['price']['standingcharge'] }}"
icon: "mdi:cash"
- name: "Smart Meter Electricity: Power"
unique_id: "smart_meter_electricity_power"
state_topic: "glow/REDACTED/SENSOR/electricitymeter"
device_class: "power"
unit_of_measurement: "kW"
state_class: "measurement"
value_template: >
{% if value_json['electricitymeter']['power']['value'] < 0 %}
{{ states('sensor.smart_meter_electricity_power') }}
{% else %}
{{ value_json['electricitymeter']['power']['value'] }}
{% endif %}
icon: "mdi:flash"
- name: "Smart Meter Gas: Import"
unique_id: "smart_meter_gas_import"
state_topic: "glow/REDACTED/SENSOR/gasmeter"
device_class: "energy"
unit_of_measurement: "kWh"
state_class: "total_increasing"
value_template: >
{% if value_json['gasmeter']['energy']['import']['cumulative'] == 0 %}
{{ states('sensor.smart_meter_gas_import') }}
{% else %}
{{ value_json['gasmeter']['energy']['import']['cumulative'] }}
{% endif %}
icon: "mdi:fire"
- name: "Smart Meter Gas: Import (Today)"
unique_id: "smart_meter_gas_import_today"
state_topic: "glow/REDACTED/SENSOR/gasmeter"
device_class: "energy"
unit_of_measurement: "kWh"
state_class: "measurement"
value_template: >
{% if value_json['gasmeter']['energy']['import']['day'] == 0
and now() > now().replace(hour=0).replace(minute=1).replace(second=0).replace(microsecond=0) %}
{{ states('sensor.smart_meter_gas_import_today') }}
{% else %}
{{ value_json['gasmeter']['energy']['import']['day'] }}
{% endif %}
icon: "mdi:fire"
- name: "Smart Meter Gas: Import (This week)"
unique_id: "smart_meter_gas_import_week"
state_topic: "glow/REDACTED/SENSOR/gasmeter"
device_class: "energy"
unit_of_measurement: "kWh"
state_class: "measurement"
value_template: "{{ value_json['gasmeter']['energy']['import']['week'] }}"
icon: "mdi:fire"
- name: "Smart Meter Gas: Import (This month)"
unique_id: "smart_meter_gas_import_month"
state_topic: "glow/REDACTED/SENSOR/gasmeter"
device_class: "energy"
unit_of_measurement: "kWh"
state_class: "measurement"
value_template: "{{ value_json['gasmeter']['energy']['import']['month'] }}"
icon: "mdi:fire"
- name: "Smart Meter Gas: Import Unit Rate"
unique_id: "smart_meter_gas_import_unit_rate"
state_topic: "glow/REDACTED/SENSOR/gasmeter"
device_class: "monetary"
unit_of_measurement: "GBP/kWh"
state_class: "measurement"
value_template: "{{ value_json['gasmeter']['energy']['import']['price']['unitrate'] }}"
icon: "mdi:cash"
- name: "Smart Meter Gas: Import Standing Charge"
unique_id: "smart_meter_gas_import_standing_charge"
state_topic: "glow/REDACTED/SENSOR/gasmeter"
device_class: "monetary"
unit_of_measurement: "GBP"
state_class: "measurement"
value_template: "{{ value_json['gasmeter']['energy']['import']['price']['standingcharge'] }}"
icon: "mdi:cash"
This will bring in all the entities that are relevant to our use.
On top, we need to create 2 entities that track today’s costs for each of the energy type. They are not included in MQTT so we will need to create the templates and do the calculations ourselves:
template:
sensor:
# Energy Costs
- name: "Smart Meter Electricity: Cost (Today)"
unique_id: smart_meter_electricity_cost_today
device_class: monetary
unit_of_measurement: "GBP"
state_class: "total_increasing"
icon: mdi:cash
state: "{{ (
states('sensor.smart_meter_electricity_import_today') | float
* states('sensor.smart_meter_electricity_import_unit_rate') | float
+ states('sensor.smart_meter_electricity_import_standing_charge') | float
) | round(2) }}"
- name: "Smart Meter Gas: Cost (Today)"
unique_id: smart_meter_gas_cost_today
device_class: monetary
unit_of_measurement: "GBP"
state_class: "total_increasing"
icon: mdi:cash
state: "{{ (
states('sensor.smart_meter_gas_import_today') | float
* states('sensor.smart_meter_gas_import_unit_rate') | float
+ states('sensor.smart_meter_gas_import_standing_charge') | float
) | round(2) }}"
Reload your HA config (manually configures mqtt and templates) or restart HA for the entities to become available. You should now have 16 new entities.
Due to limitations on how HA works, these cannot be grouped in devices in their current form. That is because we are not doing MQTT Discovery not are we creating these devices via an Integration. I am considering looking into a custom HACS integration, but I do not have much experience with it so it will be a learning curve for me.
For anyone used to using the DCC integration, these numbers match those ones but they are updated much more frequently, around 6 seconds, as soon as the IHD pushes in an update. No more cloud need, and for anyone using the old MQTT integration, no more need to run DCC integration in parallel just to get the unit price and standing prices (and costs) - However we owe terrible respect to the people that are working on that helping people that do not have the IHD
Now onto the HA Energy side of things. The entities we need to use are as follow:
Smart Meter Electricity: Import
Use an entity tracking the total costs: Smart Meter Electricity: Cost (Today)
Smart Meter Gas: Import
Use an entity tracking the total costs: Smart Meter Gas: Cost (Today)
And that should be it
As these are long term statistics, despite the entities providing you values (like the total of Import), the Energy dashboard will not show historical data, not even for the day. The stats will be populated from the moment you create your entities. As the statistics get populated everything should look as expected.
If anyone has any info to save me some research time about custom HACS integrations, that would be great. For any other help, please @ me in this thread.
Hope this helps!
PS: I have chosen to exclude information about Gas Export because it is highly unlikely any of us exports gas into the grid but also information about the IHD status, the HAN network or the serial numbers of the meters. The full MQTT topic is at the end of this post, and if anyone needs help setting up extra entities let me know.
PPS: I do not (yet) have solar panels so I can’t quite help in terms of export information aside from making that entity available. I would expect you guys to have 3rd party software (enphase, tesla etc) handling that part of the process and integration that way?
NOTE: Some meters are reporting figures in MW, so the there will be a difference of a factor of 1000. If you are affected by that, here is a workaround for the cost entities:
state: >-
{{ ((states('sensor.smart_meter_electricity_import_today') | float * 1000
* states('sensor.smart_meter_electricity_import_unit_rate') | float)
+ states('sensor.smart_meter_electricity_import_standing_charge') | float)
| round(2) }}
Full MQTT available messages. Redacted for privacy:
glow/REDACTED/STATE{
"software":"v1.8.12",
"timestamp":"2022-06-07T10:04:58Z",
"hardware":"GLOW-IHD-01-1v4-SMETS2",
"ethmac":"REDACTED",
"smetsversion":"SMETS2",
"eui":"REDACTED",
"zigbee":"1.2.5",
"han":{
"rssi":-52,
"status":"joined",
"lqi":192
}
}
glow/REDACTED/SENSOR/electricitymeter{
"electricitymeter":{
"timestamp":"2022-06-07T10:05:22Z",
"energy":{
"export":{
"cumulative":0.000,
"units":"kWh"
},
"import":{
"cumulative":4626.900,
"day":2.885,
"week":12.718,
"month":59.715,
"units":"kWh",
"mpan":"REDACTED",
"supplier":"REDACTED",
"price":{
"unitrate":0.19880,
"standingcharge":0.23760
}
}
},
"power":{
"value":0.429,
"units":"kW"
}
}
}
glow/REDACTED/SENSOR/gasmeter{
"gasmeter":{
"timestamp":"2022-06-07T10:05:36Z",
"energy":{
"export":{
"cumulative":0.000,
"units":"kWh"
},
"import":{
"cumulative":17257.783,
"day":0.489,
"week":34.503,
"month":65.038,
"units":"kWh",
"mprn":"REDACTED",
"supplier":"REDACTED",
"price":{
"unitrate":0.04650,
"standingcharge":0.26590
}
}
},
"power":{
"value":0.000,
"units":"kW"
}
}
}
Bonus Content
Did you know you can replicate the Energy dashboard in Lovelace, and then include your own other entities, allowing you to hide it from the sidebar and just use your Lovelace?
Find below my setup, with the only mention that I am using custom layout card. You can probably change to adapt it to your liking, but hopefully it inspired some of you.
- title: ''
path: energy
icon: mdi:flash
type: custom:grid-layout
layout:
grid-template-columns: 1fr 1fr 1fr
grid-template-areas: |
"date date date"
"graphs graphs graphs"
"sources sources distribution"
"entities entities entities"
mediaquery:
'(max-width: 900px)':
grid-template-columns: 100%
grid-template-areas: |
"date"
"graphs"
"sources"
"distribution"
"entities"
badges: []
cards:
- type: energy-date-selection
view_layout:
grid-area: date
- type: custom:layout-card
layout_type: grid
layout:
margin: 0 -4px
grid-template-columns: 1fr 1fr
grid-template-rows: auto
mediaquery:
'(max-width: 900px)':
grid-template-columns: 1fr
cards:
- type: energy-usage-graph
title: Electricity usage
- type: energy-gas-graph
title: Gas usage
view_layout:
grid-area: graphs
- type: energy-sources-table
title: Sources
view_layout:
grid-area: sources
- type: energy-distribution
title: Energy distribution
card_mod:
style: |
ha-card {
height: 100%;
}
view_layout:
grid-area: distribution
- type: custom:layout-card
layout_type: grid
layout:
margin: 0 -4px
grid-template-columns: 1fr 1fr
grid-template-rows: auto
mediaquery:
'(max-width: 900px)':
grid-template-columns: 1fr
cards:
- type: entities
entities:
- entity: sensor.smart_meter_electricity_import_today
name: Import (Today)
- entity: sensor.smart_meter_electricity_cost_today
name: Cost (Today)
- entity: sensor.smart_meter_electricity_import
name: Import
- entity: sensor.smart_meter_electricity_import_this_week
name: Import (This week)
- entity: sensor.smart_meter_electricity_import_this_month
name: Import (This month)
- entity: sensor.smart_meter_electricity_import_unit_rate
name: Import Unit Rate
- entity: sensor.smart_meter_electricity_import_standing_charge
name: Import Standing Charge
title: Electricity
- type: entities
entities:
- entity: sensor.smart_meter_gas_import_today
name: Import (Today)
- entity: sensor.smart_meter_gas_cost_today
name: Cost (Today)
- entity: sensor.smart_meter_gas_import
name: Import
- entity: sensor.smart_meter_gas_import_this_week
name: Import (This week)
- entity: sensor.smart_meter_gas_import_this_month
name: Import (This month)
- entity: sensor.smart_meter_gas_import_unit_rate
name: Import Unit Rate
- entity: sensor.smart_meter_gas_import_standing_charge
name: Import Standing Charge
title: Gas
view_layout:
grid-area: entities