Custom Component: Nikobus

When I replace

address: "25E952"

with

address: 25E952

HA automatically replace is with this, after saving

address: null

Hi, first want to say, thx for helping out with the support of nikobus integration.
I need some help in relation to a strange behavior.

I have a automation that triggers a switch on a nikobus switch module for my office. It is triggered by a sensor that indicates room occupancy. So lights going on when there is one person in the room, and off when nobody is in the room anymore.

It works great, but sometimes, other lights also are impacted with this.
this is what is happening
original situation

  • office light off
  • toilette light off
  1. I go to the toilette (next to the office) and enable the light with a niko push button.
  2. I leave the toilette and disable the light with a nikopush button
  3. within the 2,3 seconds I go to the office
  4. the lights going on in the office
  5. the lights going also on in the toilette…

can someone help me out why this is happening, and what I can do to prevent this?
the push button are having the proper impact modules set afaik.

the push button config:

 {
            "description": "nikobus-wcbeneden-aan",
            "address": "AC81CD",
            "impacted_module": [
                {
                    "address": "2FA7",
                    "group": "1"
                }
            ]
        },
        {
            "description": "nikobus-wcbeneden-uit",
            "address": "EC81CD",
            "impacted_module": [
                {
                    "address": "2FA7",
                    "group": "1"
                }
            ]
        },

the nikobus module config:

 {
            "description": "Switch Module S1",
            "model": "05-000-02",
            "address": "2FA7",
            "channels": [
                {"description": "Keuken Algemeen", "led_on":"", "led_off":""},
                {"description": "Keuken Onder Kastjes", "led_on":"", "led_off":""},
                {"description": "Living Eetplaats", "led_on":"", "led_off":""},
                {"description": "Bureau Kristof", "led_on":"", "led_off":""},
                {"description": "WC Beneden", "led_on":"", "led_off":""},
                {"description": "Bureau Jessy", "led_on":"", "led_off":""},
                {"description": "Slaapkamer/Berging", "led_on":"", "led_off":""},
                {"description": "Hal Boven Midden", "led_on":"", "led_off":""},
                {"description": "Trap Beneden", "led_on":"", "led_off":""},
                {"description": "Trap Boven", "led_on":"", "led_off":""},
                {"description": "WC Boven", "led_on":"", "led_off":""},
                {"description": "Hal Beneden Sfeer", "led_on":"", "led_off":""}
            ]
        }

This code looks ok to me.

Double check that your button address is correct. EC81CD

And validate with the development tools you actually get an event when the button is pushed.

I had similar unexplainable behaviour and realised after long time I had a typo in the address.

I think the component updates a full module group at once. So when HA hasn’t captured your toilet light change because of the physical button detection it still assumes the light is on.

Another way of testing is look at the HA app when you turn on and off the toilet light with the physical button.
The light should change status in HA almost instantly when you push the buttons. If it also only goes on but not off something is wrong in your code.

Your analysis is correct, we cannot update one module output at a time, we always set 6 channels at the time (group1 or group2) for a 12 outputs module.

If the integration has not recorded your toilet being off, the update sent to the module following the detection in the office will be the last known status of the toilet ON.

Enable debuglog, check what is happening when you shutdown the toilet light. You should see a module refresh happening with the correct status of the outputs. Post it here might you need some assistance.

When I use your address 25E952 it is indeed replaced by a null, when I use my address 9A93EE, it is not

Try this in your event data, use 9A93EE without quote just to see if the address remains or replaced by null.

address: 9A93EE

That would explain why I can’t reproduce your problem, my address works 9A93EE and yours do not aka replaced by null 25E952

What is happening

  • 9A93EE contains letters (A, E) so YAML (and HA’s UI) keeps it as a string.
  • 25E952 is only digits plus E, which YAML can interpret as scientific notation (25E95225 × 10^952) if it is treated as a number-like token.
  • Home Assistant’s automation UI then tries to parse/validate it as a number (or JSON-ish value), fails/overflows, and the value ends up being written back as null.

So: 25E952 is being misinterpreted as a numeric exponent token, not a plain string. That is why it gets “eaten” and replaced by null, while 9A93EE survives.

That will be a nice one to crack, at least we know why now.

We must use address : " xxxxxx", now why it’s not firing with timer_2, will check once home.

If you want, paste the exact event payload from Developer Tools → Events (listen to nikobus_button_timer_2 and press that physical button). I can confirm whether the event uses address as a string, and whether it is upper/lowercase, padded, etc.

This also explains perfectly why:

  • 9A93EE works unquoted
  • 25E952 breaks

Sorry for my question, I never used this before.
What should I fill into the field ‘Gebeurtenistype’ (Eventtype)

Just look at the bottom section, the top one is not relevant in this case / not used.

Input the name of the event you want to listen, eg nikobus_button_press and hit start.

Then press a physical Nikobus button and see if the event is being fired on that very same ha screen. You can do that for any nikobus_button_xxxx event.

Release 0.7.0b is out. Mind this is a beta release, not everything has been 100% tested, please report any unexpected behaviour, and as always take a backup before any upgrade.

BREAKING CHANGES

The entities_id have been standardized
The events have been completly reworked ‘nikobus_button_press’ etc…
See the readme file fdebrus/Nikobus-HA

1 Like

If you have a PC Link module and it’s used for connectivity

You can now use module_discovery, execute it without checking the “module address” box, this is reserved for future use.

1- It will create a file /config/nikobus_module_discovered.json

The file will have the full inventory of your modules and address

2- It will enrich your /config/nikobus_button_config.json

Take a backup of the file before proceeding, better safe than sorry.
Each button will receive a “discovery_info” section as

            "discovered_info": [
                {
                    "type": "IR Button with 4 Operation Points",
                    "model": "05-348",
                    "address": "0FFEC0",
                    "channels": 4,
                    "key": "1C"
                }
            ]

Nikobus Integration will automatically reload following a discovery.

Each button will then have its model associated

And the attributes of the button will be populated

Hi,

I just upgraded to 0.7.0b.
The documentation says

  1. Go to Settings → Devices & Services → Integrations
  2. Open Nikobus
  3. Click Entities
  4. Use Recreate entity IDs

Where is the ‘Recreate entity IDs’ option?

Is this the button you mean?


Do I have to do this for each device , or for each entity?
I first ask it because I have 216 devices and 488 entities of Nikobus :grinning:

You can all at once :slight_smile: not one by one…

click entities here → “315 entities”

Then … top right

You should have re-create entities ID, cannot show you as mine are already done.

I don’t see the re-create entities… :cold_sweat:

I found it.
I had to select them all :partying_face:

Will update the readme :slight_smile:

You should now have faster “nikobus_button_press” event, as soon as the physical button is pressed, new events and new data payload to the events.

Following internal optimization and indexing, the button_press_event is now fired immediatly

2026-01-04 18:10:13.674 DEBUG (MainThread) [custom_components.nikobus.nkblistener] Received message: #N0AA8FA
2026-01-04 18:10:13.674 DEBUG (MainThread) [custom_components.nikobus.nkblistener] Button command received: #N0AA8FA, extracted address: 0AA8FA
2026-01-04 18:10:13.674 DEBUG (MainThread) [custom_components.nikobus.nkbactuator] Handling button press for address: 0AA8FA
2026-01-04 18:10:13.674 DEBUG (MainThread) [custom_components.nikobus.nkbactuator] Firing event nikobus_button_pressed with data: {‘address’: ‘0AA8FA’, ‘module_address’: ‘0E6C’, ‘channel’: None, ‘ts’: ‘2026-01-04T17:10:13.674702+00:00’, ‘press_id’: ‘0AA8FA-866002.775-0fefb6c4’, ‘state’: ‘pressed’, ‘duration_s’: None, ‘bucket’: None, ‘threshold_s’: None, ‘source’: ‘nikobus’}

Nikobus 0.7.0 has a cover (shutter) bug, fixing and releasing 0.7.1

@fdebrus BIG thank you for all of your effort. I upgraded from 0.6.0 to 0.7.1 today and it went fairly smooth, even with the change in names.

One thing I had to do was recreate all lights for the switch module entities.
As most items of my switch module are lights I select the entity and do “show as light” which creates a new light entity and hides the original switch entity.

I still think allowing for an entity type value in the nikobus module config yaml file next to the “description” could be a good idea but I do realize that would impact your code massively

@fdebrus I noticed that for the most recent version of HA and the 0.7.1 version of the add on I often a config failed message get see screenshot below

If I click reconfigure and leave all settings as is it says configuration successful.
Not sure why it gives the failure message. It didn’t use to do that in the past after restarts

Do you have the same in your log ? could you share your nikobus_module_config.json

I could harden the code not to blow up when something is wrong in the config file, but let’s check first what’s wrong in your config file.

Error setting up entry Nikobus (/dev/ttyUSB0) for nikobus
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 762, in __async_setup_with_context
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/nikobus/init.py”, line 59, in async_setup_entry
await coordinator.connect()
File “/config/custom_components/nikobus/coordinator.py”, line 118, in connect
for address, module_info in modules.items():
^^^^^^^^^^^^^
AttributeError: ‘list’ object has no attribute ‘items’

Is it’s possible,it’s this one ?

Logger: homeassistant.config_entries
Bron: config_entries.py:762
Eerst voorgekomen: 14:54:05 (1 gebeurtenis)
Laatst gelogd: 14:54:05

Error setting up entry Nikobus (/dev/ttyUSB0) for nikobus
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 762, in __async_setup_with_context
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/nikobus/init.py”, line 90, in async_setup_entry
await _async_cleanup_orphan_entities(hass, entry, coordinator)
File “/config/custom_components/nikobus/init.py”, line 148, in _async_cleanup_orphan_entities
for device in dev_reg.devices.values():
~~~~~~~~~~~~~~~~~~~~~~^^
RuntimeError: dictionary changed size during iteration

You troubles should be fixed by 0.7.2

could you share you nikobus_module_config file ?