As @pabla suggested turning on add-on debugging was useful for me.
I was able to see that another .conf was messing up mosquitto.conf
Once I deleted it, I saw in the log that mosquitto.conf was properly loaded
As @pabla suggested turning on add-on debugging was useful for me.
I was able to see that another .conf was messing up mosquitto.conf
Once I deleted it, I saw in the log that mosquitto.conf was properly loaded
Thanks! Are you using a relatively new bchydro energy hub for hardware ? I’ll try the above tonight. Thank you!
Finally got this all working again today - my IP address on the Homebridge had changed, and also I didnt realize I had to rename to mosquitto.conf - thanks for the comments all!
My MQTT connection has been stable for months. In the last 3-4 weeks it seems the connection randomly drops out. A restart of the MQTT add-on seems to fix it and it reconnects for a while.
Anyone experiencing something similar?
I’ve had the same intermittent dropouts (fixed by restarting the broker) since the Mosquitto update a few months ago, it’s pretty annoying. I haven’t identified the root cause.
Hmm, this looks like a related bug that’s been reported: Bridge does not automatically reconnect when initial connection attempt fails · Issue #2795 · eclipse/mosquitto · GitHub
Haha, and it looks like the fix has been sitting around for 4 months, unreleased: Fix bridges being expired after being restored. · eclipse/mosquitto@6d240a9 · GitHub
I think that this has been published now: I’ve received two updates for Mosquitto this week, and it seems to be reconnecting properly after HA reboots.
Yes, I had the same issue. It appears to be connecting properly now after a reboot.
Considering setting up the HydroHub / Bridge but since It costs about $150 I am wondering if it is worth it or no.
It seems like a nice way to get the EXACT utility demand real time without adding a bunch of clamp devices in the main panel…
However the MQTT setup sounds like it isn’t that reliable? High potential to be blocked / broken in the future?
In all the time I’ve been using it it only broke once (due to MQTT version, nothing to do with BCHydro or Powerley) so it’s not really “unstable”.
It only cost me $50 officially thru BCHydro/Powerley - wow the price has really gone up a LOT! I wonder if it would be easier to just get one of the RainForest devices instead now.
Edit: looks like those already with a Rainforest device are grandfathered in, but they wont allow new connections. Guess Powerley HydroHome Hub (or clamps) are the only way now.
OK so does this setup work with the “Energy Bridge (HydroHome Hub)” or does it only worked with an older device from RainForest?
I wanted to avoid clamps as 1. it looks like a mess and 2. I really don’t want to get in there and clamp the main feed lines as those are the only ones I can’t turn off.
The setup detailed above only works with the “Energy Bridge HydroHome Hub” from Powerley, in collaboration with BC Hydro.
There are separate threads/details for the older Rainforest devices (tho as I said above, they only worked if you bought it in the past - if you try to buy one now BC Hydro no longer allows you to connect it to their meters)
No because there is a reason HA doesn’t accept site scraping components, they tend to be fragile. I read that and it wasn’t clear to me if it was fixed, or just an idea how to fix the script.
At any rate it is “yesterdays” data when you use that method, I was interested in near real time data in order to track down the source while it is happening.
Just did the setup, two notes I did not see mentioned…
When you get the hub take note of the fact they mention binding might take 48hrs… From what I observed every binding attempt would fail within one hour… Tired several times on the evening the hub arrived, but tried again after 8 am the next day and it went through… I wonder if someone has to manually approve the binding during business hours.
The format of mqtt sensors has changed here is an example
mqtt:
sensor:
- name: "BCHydro Grid Consumption"
unique_id: energy_bridge_summation_minute_kwh
state_topic: "event/metering/summation/minute"
icon: mdi:transmission-tower
unit_of_measurement: 'kWh'
# the Energy Bridge returns "Watt-minutes" (Wmin) every minute; convert it to kilowatt-hours
value_template: "{{ value_json.value | float / 60000 }}"
# the "time" in the message is a Unix-like timestamp (in milliseconds) of the start of the last reading
last_reset_value_template: "{{ now().fromtimestamp(value_json.time / 1000).replace(tzinfo=now().tzinfo) }}"
device_class: energy
state_class: total
- name: "BCHydro Instantaneous Demand"
unique_id: energy_bridge_instantaneous_demand
state_topic: "event/metering/instantaneous_demand"
icon: mdi:transmission-tower-export
value_template: "{{ value_json.demand | int }}"
unit_of_measurement: 'W'
device_class: power
state_class: measurement
Do you still have this working with the BCHydro Hydrohome?
What do you mean exactly?
Does the Hydrohome app still work? Yes
The integration here simply tells YOUR MQTT server to grab the info from the expose MQTT server on the Hydrohome hub.
Okay, thanks BlinkyLights, I’ll keep working at it. I just don’t see any MQTT data to the sensors. I think I may have the mosquitto.conf file in the wrong spot.
I have the hub connected and I can see the mqtt data every minute using terminal but not with the sensors. I’m running HA core as a VM in UnRaid. I’m just not sure where to put that mosquitto.conf file.
I’m setting up the mosquitto on this now and it’s so easy now.
I was getting a warning in the energy config screen about statistics but that seems resolved after a few minutes. Definitely needed to use the new config format for mqtt sensors.
Just in case anyone comes looking. This works for solar generation.
Create a file in /share/mosquitto/bchydroenergybridge.conf
/share/mosquitto/mosquitto.conf
with the contents:
connection bchydroenergybridge
address xxx.xxx.xxx.xxx:2883
clientid homeassistant-1
try_private false
start_type automatic
topic # both 0
# bc hydro energy bridge
mqtt:
sensor:
- name: "BC Hydro Electricity Consumption"
icon: mdi:transmission-tower
state_topic: "event/metering/summation/minute"
unit_of_measurement: "kWh"
# the Energy Bridge returns "Watt-minutes" every minute in the "value"; convert it to kilowatt-hours
#value_template: "{{ value_json.value | float / 60000 }}"
value_template: "{% if value_json.value | float > 0 %}{{ value_json.value | float / 60000 }}{% else %}{{ 0 | float }}{% endif %}"
# the "time" in the message is a Unix-like timestamp (in milliseconds) of the start of the last reading
last_reset_value_template: "{{ now().fromtimestamp(value_json.time / 1000).replace(tzinfo=now().tzinfo) }}"
device_class: energy
state_class: total
- name: "BC Hydro Electricity Return"
icon: mdi:transmission-tower
state_topic: "event/metering/summation/minute"
unit_of_measurement: "kWh"
# the Energy Bridge returns "Watt-minutes" every minute in the "value"; convert it to kilowatt-hours
value_template: "{% if value_json.value | float < 0 %}{{ value_json.value | abs | float / 60000 }}{% else %}{{ 0 | float }}{% endif %}"
# the "time" in the message is a Unix-like timestamp (in milliseconds) of the start of the last reading
last_reset_value_template: "{{ now().fromtimestamp(value_json.time / 1000).replace(tzinfo=now().tzinfo) }}"
device_class: energy
state_class: total
- name: "BC Hydro Instantaneous Demand"
icon: mdi:transmission-tower-export
state_topic: "event/metering/instantaneous_demand"
unit_of_measurement: "kW"
# the Energy Bridge returns watts, convert it to kilowatts
value_template: "{{ value_json.demand | float / 1000 }}"
device_class: power
state_class: measurement