Skip to content

Change how entities are discovered

Harley Watson requested to merge github/fork/martingrayson/master into master

Created by: martingrayson

I'm new to your project but tried setting it up with my smart meter. I discovered that it would only add my gas meter and not my electricity meter.

Upon investigation you seem to be using ["dataSourceUnitInfo"]["shid"] as a UID for the meter. My electricity and gas meter share the shid so all sensors would be created against a single device. i.e. I'd see sensor.electricity and sensor.gas appear under "Smart meter, gas". Using resourceId solves this for me, creating two meters with sensors attached to them each.

In addition to this, your loop that adds sensors doesnt reference new_entities which may be an omission.

After change: image image

Before change: image image

Merge request reports

Loading