Hi everyone,
Wishing to understand more about HA and Integration, I took the path to integrate my domotic system “Nikobus” over a custom integration.
While the connection / exchange of data towards the Nikobus controller works well. I’ve difficulties to understand what would be the best way to interact with HA switches, cover, etc… here is my first try
When I query the status of the modules it give me the status of the 6 outputs with status 00 = off or FF = on
Example
$1C6C0E00 0000000000FF D5A6E2
$1C6C0E00 tell the controller which module to interact with
D5A6E2 are CRC
So I extract “00 00 00 00 00 FF” which is the status of all 6 outputs, here with output 6 being on.
I can read / write / change status to Nikobus without any issue. Where I’m strugling to find a good logic is how to link switches in HA to a current state “0000000000FF”.
Current way of thinking
Get the status once at integration setup, so the “0000000000FF” is stored in a json
Than switches get their status from that json dict
Refresh switches status every minutes by re-running the same “data refresh” → “json”. this is needed as an actuator outside HA could have changed the state eg wall switch.
I’m guessing there is / are better way of handling this. Any guidance, advice would be much appreciated.
Here is my draft code
fdebrus/Nikobus-HA (github.com)
Thanks !