Anyone able to develop a Home Assistant Custom Component or templating ?

I’ve just got the Glow CAD to go with my new smart meters for Agile Octopus.

I’m planning in the next few months to get Solar and a Powerwall.

I’ve linked the MQTT data to Home Assistant using the Node Red flow that was published in this forum (thanks!)

It’s the first time I’ve used Node Red, and I’d prefer to not need a Node Red Server if I could achieve the same in a custom component. I might even have a go at creating one or trying to achieve the JSON splitting and maths using templating.

Before I do, thought I’d ask if anyone has already got the data through to Home Assistant without using Node Red?



  • There is a Home Assistant component available here but it is lacking key features. As for templating, I might give it a go as I've played with it before and it's really not that tough. The JSON that the MQTT stream produces is a bit obscure so I might need some tinkering.

    If you'd like to have a go at it yourself, I would suggest running my mosquitto_sub command to see what MQTT spits out and looking at Home Assistant's templating guide to extract the values you need from it. I haven't figured out myself what all these values mean.

  • edited July 2020

    I actually heard back from Jane from Hildebrand support, she suggested I look into the Zigbee Smart Energy Profile specification to understand the format of the MQTT payload.

    It isn't a very pleasant read, but the biggest takeaway there is that the elecMtr.0702.04.00 JSON path in the JSON payload will give you (after converting from hex to decimal) electricity consumption (it is not available for gas as that is only picked up every half hour), and the elecMtr.0702.00.00 as well as gasMtr.0702.00.00 JSON paths should give you electricity and gas meter readings.

    A bit of background on the different fields from reading the docs:

    0702: Metering
    - 00: Reading Information Set
     - 00: CurrentSummationDelivered: energy consumed (meter)
     - 01: CurrentSummationReceived: solar panels production?
     - 02: CurrentMaxDemandDelivered: ?
     - 07: ReadingSnapshotTime: UTC time
     - 14: Supply Status: 0x2 is on
    - 02: Meter Status
    - 03: Formatting
    - 04: Historical Consumption
     - 00: InstantaneousDemand (Signed)
     - 01: CurrentDayConsumptionDelivered
     - 30: CurrentWeekConsumptionDelivered
     - 40: CurrentMonthConsumptionDelivered
    0705: Prepayment
    0708: Device Management
  • Well done on plowing through the Zigbee SEP spec, welcome to our world! ;)

    Thanks for adding to the knowledge base and welcome to the forums @ndfred

  • that's great, thanks. I'm having a go now.

  • I figured it out! I published a writeup of how to configure Home Assistant to work with a Glow device over MQTT:

  • edited July 2020

    Ok, success.

    I'm using hassOS with the Mosquitto Broker.

    So first thing was to bridge the Bright MQTT to my mosquitto MQTT:

    In Mosquitto Broker config:


    active: true 

    folder: mosquitto

    Then in /share/mosquitto/glowmqtt.conf

    connection glowmqtt



     try_private false

     notifications true

     start_type automatic

     remote_clientid glow

     remote_username xxxxxxxxxxxxxxx

     remote_password xxxxxxxxxxx

     keepalive_interval 300

     cleansession true

     bridge_protocol_version mqttv311

     local_clientid homeassistant

     bridge_cafile /etc/ssl/certs/ca-certificates.crt

    Then in the YAML:


     - platform: mqtt

      name: "MQTT Elec Meter"

      device_class: power

      icon: mdi:counter

      unit_of_measurement: "kwh"

      state_topic: "SMART/HILD/XXXXXXXXXXX"

      value_template: "{{ ((value_json.elecMtr['0702']['00']['00'] | int(base=16)) / 1000 )| int }}"

     - platform: mqtt

      name: "MQTT Elec Demand"

      device_class: power

      icon: mdi:flash-alert

      unit_of_measurement: "kw"

      state_topic: "SMART/HILD/XXXXXXXXXXX"

      value_template: "{{ (value_json.elecMtr['0702']['04']['00'] | int(base=16)) / 1000 }}"

     - platform: mqtt

      name: "MQTT Export Power"

      device_class: power

      icon: mdi:flash-outline

      unit_of_measurement: "kwh"

      state_topic: "SMART/HILD/XXXXXXXXXXX"

      value_template: "{{ (value_json.elecMtr['0702']['00']['01'] | int(base=16)) / 1000 }}"

     - platform: mqtt

      name: "MQTT Grid Power"

      device_class: power

      unit_of_measurement: "kwh"

      icon: mdi:flash-circle

      state_topic: "SMART/HILD/XXXXXXXXXXX"

      value_template: "{{ ((value_json.elecMtr['0702']['04']['00'] | int(base=16))-(value_json.elecMtr['0702']['00']['01'] | int(base=16))) / 1000  }}"

     - platform: mqtt

      name: "MQTT Gas Meter"

      device_class: power

      icon: mdi:speedometer-slow

      unit_of_measurement: "kwh"

      state_topic: "SMART/HILD/XXXXXXXXXXX"

      value_template: "{{( (value_json.gasMtr['0702']['00']['00'] | int(base=16)) / 1000) | int }}"

     - platform: mqtt

      name: "MQTT pan"

      state_topic: "SMART/HILD/XXXXXXXXXXX"

      value_template: "{{ value_json['pan']['status'] }}"

      json_attributes_topic: "SMART/HILD/XXXXXXXXXXX"

      json_attributes_template: "{{ value_json.pan | tojson }}"   

  • just need to work out how to deal with the signed hex in :

     - 00: InstantaneousDemand (Signed)

  • Or I could have read your post above properly that said you’d written the instructions, that are pretty similar to mine !

  • edited July 2020

    If you are not exporting energy just treat InstantaneousDemand as unsigned.

  • Excellent Info everyone, received my CAD today and with the above info I was setup in a couple minutes. I have noticed that my mosquitto broker is outputting the following every few seconds though:

    Socket error on client local.core-mosquitto.glowmqtt, disconnecting.
    Connecting bridge glowmqtt (

    Data is coming through without issue but wondering if anyone else is seeing this?

    I'd also like to say, super impressed with Glowmarkt support so far, Jane 👍️

  • I’m also having the socket error every few seconds. My connection is via a bridge in HomeAssistant. I contacted Hildebrand support, who said “The only people with issues in my logs like you are running in bridge”. I never got to the bottom of it but as my data comes through OK I am living with the spam in my log!

  • I am now exporting. So how do I handle the instantaneous demand to treat it as a signed integer ?

    in home assistant templating I mean ?

Sign In or Register to comment.