Brultech Greeneye Issues

Working on getting my Brultech Greeneye Monitor integrated to Home-Assistant. I have the integration configured for a single sensor at this point, which shows up in the UI. I’ve also run a packet capture and validated that I am getting packets from the Greeneye, but it appears they are not being processed by home-assistant as I’m not seeing any information from the sensor.

Has anyone else got this working?

@jkeljo - tagging you for visibility. thanks.

Never heard of that device. What do the logs tell you?

What does the dev-state page in ha tell you?

Can you share your config (both the greeneye monitor part of HA and the settings from the packet send tab on the GEM)? Also, any exceptions in the log?

No exceptions in the log.

Configuration for greeneye from H-A here:

port: 5000
monitors:
  - serial_number: XXXXXXXX
    channels:
      - number: 1
        name: total_power

And packet send tab here-

https://i.imgur.com/aJj6xN2.png

That looks fine. The port matches whatever’s set on the GEM’s network tab?

Note that your serial number should be just the last 5 digits (omitting leading zeroes). For me, that results in a 3-digit number. If that’s the issue, I’ll submit a PR to make it more flexible.

Thanks for the serial number hint. Switching to the last 3 digits solved the problem and I’m seeing data now.

Cool, glad that fixed it. I’ve just put up a PR to use the full serial number (omitting leading zeroes) instead of the last 5 digits: https://github.com/home-assistant/home-assistant/pull/19631

It’s a breaking change, unfortunately (you’ll have to go fix up the unique IDs in your entity registry if it’s accepted), but much less confusing (and immune to the possibility of supposedly-unique IDs colliding for people who have multiple GEMs installed).

Since this is the only Brultech and Greeneye thread a search gave me, I figured I would ask my question here …

How are you calculating your kwH totals? I am interested in seeing daily totals + monthly totals.

I think I can figure out the daily total by summing the total W and running the kwH calculation, but I am confused on where I would need to store the data to get it compiled for a running monthly average. Thanks!

I have 3 GEMs that I’m trying to get working with HA. 2 of them are connected to a Dashbox (COM1 and 2) and the 3rd one has a Ethernet module. The view from the Dashbox is as follows:

So everything works great for sending packets to the Dashbox, but I’d like to switch over to HA for all my monitoring and tracking of power usage.

This is my setup:

10.0.1.150 Dashbox with 2 GEMs connected directly to it via RS232 COM ports
10.0.1.151 GEM with Ethernet module
10.0.20.99 My HA server

10.0.1.150:8001 takes me to GEM1 from a browser
10.0.1.150:8002 takes me to GEM2 from a browser
10.0.1.151:8000 takes me to GEM3 from a browser

The below config does not work:

configuration.yaml:

greeneye_monitor:
port: 8000
monitors:

  • serial_number: “01001221”
    channels:
  • number: 1
    name: GEM1_Channel1
  • serial_number: “01001222”
    channels:
  • number: 1
    name: GEM2_Channel1
  • serial_number: “01021400”
    channels:
  • number: 1
    name: GEM3_Channel1

Screencap:

The above with with Packet Forwarding on the Dashbox set to:

IP: 10.0.20.99
Port: 8000
RS232 Port: Both
Persistent Connection: checked
Device: All Devices (the dropdown only lets be pick between my 2 1240 devices)

I posted about the issue over on the Brultech support forum, but I seem to be going in circles with Ben.

https://www.brultech.com/community/viewtopic.php?f=11&t=2195&p=14724&sid=347ac2c3fff72ae527840c836055f881#p14724

Supposedly I should be able to have the Dashbox forward packets to HA for all 3 of my GEMs without having to purchase Ethernet modules for the 2 GEMs connected to the Dashbox. That said, I’m not even able to get the GEM with an Ethernet module talking to HA…

Also, any chance the ECM-1240’s are supported, either directly or through the Dashbox?

Thanks!

1 Like

Looks like my issue could be that I’m missing some json files:

Line 5392: 2021-11-11 04:37:11 DEBUG (SyncWorker_4) [homeassistant.util.json] JSON file not found: /usr/src/homeassistant/homeassistant/components/greeneye_monitor/translations/sensor.en.json
Line 5398: 2021-11-11 04:37:11 DEBUG (SyncWorker_4) [homeassistant.util.json] JSON file not found: /usr/src/homeassistant/homeassistant/components/greeneye_monitor/translations/en.json

Any idea how to fix this?

1 Like

Got it working. Have DashBox forward packets to HA for the 2 RS232 connected GEMs and the Ethernet GEM forwarding packets directly. Ben @ Brultech is working on a firmware update for the DashBox that will allow my Ethernet GEM to send packets to DashBox, which are then forwarded to my HA server.

This way I can keep the DashBox updated while I get everything going in HA.

Btw, I’m using Bin 48 NET Time format on all 3 GEMs.

2 Likes

Since there are very few GEM threads here (and the Home Assistant page suggests there are only 17 active installations using the integration), I figured I’d post my setup here for anyone looking for information.

Configuring the GEM integration is relatively straightforward. My configuration looks something like this:

greeneye_monitor:
  port: 22022
  monitors:
    - serial_number: "XXXXXXX"
      channels:
        - number: 1
          name: hvac
        - number: 2
          name: garage
        - number: 3
          name: bedroom

…etc.

The sensors report instantaneous power (W) with an energy attribute (Ws). So in order to create a utility meter for the sensors, I created template sensors to extract the Ws attribute and convert it to kWh:

# Brultech kWh Energy Templates
  - platform: template
    sensors:
      hvac_kwh: 
        value_template: "{{(state_attr('sensor.hvac_power','watt_seconds') | int / 3600000) | round(2)}}"
        unit_of_measurement: kWh
      garage_kwh:
        value_template: "{{(state_attr('sensor.garage_power','watt_seconds') | int / 3600000) | round(2)}}"
        unit_of_measurement: kWh
      bedroom_kwh:
        value_template: "{{(state_attr('sensor.bedroom_power','watt_seconds') | int / 3600000) | round(2)}}"
        unit_of_measurement: kWh

So now I have template sensors reporting for each CT in kWh. These can be fed into utility meter directly:

utility_meter:
  hvac_energy:
    source: sensor.hvac_kwh
    name: HVAC Energy
    cycle: daily
  garage_energy:
    source: sensor.garage_kwh
    name: Garage Energy
    cycle: daily
  bedroom_energy:
    source: sensor.bedroom_kwh
    name: Bedroom Energy
    cycle: daily

I display the results on a lovelace-auto-entities card and sort descending by energy usage for the day.

Hopefully this is helpful for someone else.

2 Likes

Looking for some help in getting my GEM to integrate into HA. I’m looking at migrating from Homeseer and getting Greeneye to work is a necessary step before I proceed. I’ve got a GEM and a dashbox. I currently use the packet forwarding setting to push the data to my homeseer home automation system.

For my Home Assistant setup, I’m installed on an OracelVM VirtualBox Ubuntu 64bit on the same hardware as my Homeseer installation (which is just running in Windows). I’ve created a new packet forwarding entry in the Dashbox where the IP is the IP of my Home Assistant device and I’m using port 22022. I’ve used the very staightforward YAML code (copy and pasted Mark_f’s) in this forum with the serial number of my device and the same 22022 port and have set up 4 channels as a test. When I reboot my Home Assistant, the 4 channels are created as sensors, but the data is “unknown” instead of an actual value.

I’ve tried the following (always rebooting HA and my Dashbox) without any success:

  • switching the data between bin-32 and bin-48
  • removing the packet forwarding entry to my homeseer system so the dashbox is only sending data to home assistant.
  • Turned off the firewall on the windows device that the VM software is installed on

Hypotheses:

  • Could there be an issue where Home Assistant is blocking the data flow? The networking setting on the VM instance is set to “promiscuous”. I don’t have any other issues across any of my other 18 integrations that I am testing so am thinking this isn’t the issue
  • What else could it be?

Any help/ideas would be appreciated

I send data directly from GEM to HA, so my setup is slightly different. A few things I have noticed which may help you as well: (my dashbox died 3 times already and I am tired of it)

-when I had trouble getting data, it turned out to be a typo in the serial number.

  • in older versions the serial number had to be decreased by 1. In the current HA, it needs to match the GEM displayed serial number
  • you can define the port number, since you copied Mark’s setup, the 22022 should be correct.
  • you can always test the connection by using telnet, you may need a tool like Putty. Enter the IP of your HA and port 22022, select telnet and then connect. If a connection is established (you will not see anything) it has a connection and the port is reachable. If you get a connection error, something is blocking your connection
1 Like

try removing the leading 0 from the serial numbers: serial_number: “1001221”

You can’t forward packets from Dashbox to HA at this time. I chatted with Ben @ Brultech about this and did some troubleshooting on my own and hit a wall with some errors in siobrultech-protocols (https://github.com/sdwilsh/siobrultech-protocols). You should be able to get the GEM talking to directly to HA. You can then try to forward the packets from HA to Dashbox. Ben put together some sample (untested) code: https://github.com/BenK22/homeassistant_dashbox_forwarding/.

I have not tried it yet.

So I did have Dashbox forward packets to HA and it worked for a while, but it broke at some point over the last few month. It looks like it is still working when I do this:

hass_netstat_8009

My IPs are as follows:
10.0.1.150 Dashbox
10.0.1.151 GEM #1
10.0.20.99 HA Server

But all my GEM sensor data shows as unavailable in my dashboards. So I went to my GEM with an Ethernet module and pointed it directly to HA as follows:

I then deleted the packet forwarding I had setup on the Dashbox to HA and ran netstat again from HA:

hass_netstat_8009_2

So it is intermittent for some reason, but maybe that is just because it only sends packets every 8 seconds

When I point a browser at the GEM, I have this on the Packet Send tab:

And the Network tab is blank as I apparently can only configure the network from the Network Utility shown above:

My config in HA is as follows:

GEM HA Config

After a restart none of the channels showing up as entity entries. But after about 10 minutes they finally did and I could see the values changing in real-time in my dashboards.

I then added a few more channels in my configuration.yaml file, restarted HASS, and now the dashboard just shows unavailable for all the values as seen here:

When I look at the entity entries, ones that were there already looks like this:

That red circle apparently means they have been “restored” and the new ones I added are not showing up at all.

Any idea what’s going on?

I also had packet forwarding from dashbox to HA briefly working but then it would stop. I never investigate much but it’s got something to do with GEM and HA “auto configuration”. Once that’s setup Dashbox packet forwarding will work and then stop if, for example, you restart home assistant. The error in the HA logs is “siobrultech_protocols.gem.protocol on home assistant that force the connection to close”

Ah ok, that makes sense.

So what would cause the issue with a GEM with an Ethernet module sending directly to HA also being unreliable? That’s what I’m fighting with now per the details above. Should I send packets every 5 seconds instead of every 8?