micolous / cbus

Use Python to communicate with a Clipsal C-Bus PCI or CNI! Includes MQTT bridge (for Home Assistant), PCI simulator, and reverse engineering notes.
http://cbus.readthedocs.org/
GNU Lesser General Public License v3.0
49 stars 27 forks source link

Creates topics for 255 lights and binary sensors, only have 80 odd lights in CBUS network #18

Closed sladey closed 4 years ago

sladey commented 4 years ago

Have just got my CNI installed and setup cmqttd talking to HA. Really awesome, thank you so much. I am going through the usual perils of managing a large number of devices in HA. I have successfully renamed a device in HA which seems to stay in place across restarts of the broker, HA and cmqttd which is awesome. Are there any hidden gotchas with renaming in HA? Is it better to use customize.yaml?

My question is why do so many more devices get created in HA than exist on my cbus network? When I look in project.xml I do see unused tag name with a group address of 255 in the lighting application. Could that be doing it? In reality the group addresses are sparsely populated up to about 117. I am no cbus expert so being very careful with what I change on the cbus side (read nothing).

Aslo had you thought about supporting device names that come from the cbus tag name or is that something you cannot get from the network itself, ie it is only kept in the project.xml file?

lowgoz commented 4 years ago

hey dude, that's normal behaviour. It adds the full gammit of 255 addresses as thats the maxium amount that Cbus can support on each network. Im guessing its a bit of a hack to save them (Im unsure if they even can) querying the Cbus network to as it how many devices are on it..

sladey commented 4 years ago

Cool, thanks for the info.

micolous commented 3 years ago

I've added support for reading group names from the project XML now (e177f2d91de3e8c9341d42e706b47b7c06ead8ee), but cmqttd will still always enumerate all possible group address names, regardless of what's in your project file.

@lowgoz is right here: there's a way to get this information from the network (MMI status updates), but it's more complex to implement, and you need to propagate topology changes.

You can always remove unused entities from Home Assistant by defining a custom UI setup.

sladey commented 3 years ago

awesome @micolous will give it a go.