Custom Component: Nikobus

Fixed with the new release.

This works for me, I would indeed double check your button address.

alias: test
description: ""
trigger:
  - platform: event
    event_type: nikobus_button_pressed_3
    event_data:
      address: A59B02
condition: []
action:
  - service: switch.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: switch.exterieur_parking
mode: single

Itā€™s working now. :partying_face:
I added ā€˜mode: singleā€™ and itā€™s working.
Then I removed it back again, and itā€™s still working :thinking:

Is it correct that the action is executed when I release the button after 3 seconds? Maybe there was a confusion , because the things that are executed by nikobus after 3 sec, are done while pressing the button 3 sec. Here after releasing it. But that is no problem. Iā€™m happy now.

@MarcVZ Could you give me an example ?

So If I get you right, nikobus starts to process the action as soon as the button is pressed for 3secs. The integration only after releasing the button. So basically in Nikobus you can keep pushing the button for multiple seconds, as soon as the press time is greater than 3secs, the action will start.

I can change the logic to add extra events:

3 like today, triggered after button release
nikobus_button_pressed_1
nikobus_button_pressed_2
nikobus_button_pressed_3

3 new ones triggered as soon as the 1, 2 or 3 seconds have passed regardless if the button is released or not.
nikobus_button_timer_1
nikobus_button_timer_2
nikobus_button_timer_3

Is that what you mean ?

@MarcVZ New release

The following events are fired as soon as the respective timer is reached

  • nikobus_button_timer_1
  • nikobus_button_timer_2
  • nikobus_button_timer_3

Bug Fix

Stop cover was no longer possible since the introduction of feedback led support: Fixed

Found a project rbierman/nikobus: Nikobus to RS232 bridge (github.com)

About a Nikobus to RS232 bridge, so no need for PC-Link or Feedback Module etcā€¦

Untested

Hello

First of all: many thanks for the Nikobus integration in HA! Until a few days ago I was using Openhab but did make the switch now to HA. I only have rollershutters connected to the Nikobus system. These are the modules I have:
image

I have some questions regarding this integration in combination with the Nikobus software. Can I use my current system (I mean then the installation through the Nikobus softwareā€¦below you see mee current configuration for the rollershutter living room front (called ā€œbureauā€ in HA) .
Image removed because I can upload only one image because I am new.

Do I need to delete this configuration through the Nikobus software?

For now I can control already the rollershutters through HA but I have a weird situation that I do need to click 2 times rapidly into HA to control a rollershutter:
Image removed because I can upload only one image because I am new.

Also, the following automation did not work either. I tried that when the sun goes down it should close the rollershutter of my work place ā€œbureauā€. I first tried without repeating but this didnā€™t work. Two times repeating does not work either:
Image removed because I can upload only one image because I am new.

Is there a way to control the rollershutter directly through the module instead of using the button?

I am very sorry for all these questions but at this moment I donā€™t get it to work correctly. Can/Will you give me some advise please?

Happy to get your setup going, but Iā€™m on vacation till end August. Until then try to copy paste the automation code vs a picture. ?

Thanks a lot for you fast response on your vacation. No problem, I can wait until the end of august. I will try some things to see if I can get a little bit further.

Meanwhileā€¦just enjoy your vacation and we hear eachother in september.

Hi,

I did not had the time to explore all possibilities of the integration. I e.g. did not update the button configuration file, and Iā€™m also still lost how to get the feedback buttons to work. I need to add some addresses in the config, but not sure how to find them. As I only have a few of those, itā€™s not a big deal but the fact that home assistant did not update the correct status was kinda annoying.

Most of my buttons were automatically discovered, and as I wanted to give it a meaningful name and get the refresh up to date, so I tried to figure out which button corresponds to what address.

I guess I could do it by exploring them one by one, but to make my life easier I googled if there was some logic in order to obtain the Home Assistant address from the button based on the Nikobus address from the software.
It turns out that via this Link someone tried it already in OpenHab.

He summarized it as:

  • Convert to binary representation
  • Take bits 2 till 22
  • Prepend 3 bits for the button.
  • Reverse the order
  • Convert back to hex
  • Prepend ā€œ#N#ā€

After some trial and error, I think I figured it out.
Itā€™s not an absolute proof, but It matches with all switches I have. For the shared (last 5) characters of the switches, Iā€™m rather sure, and it almost corresponds to the method as explained for OpenHab. (the only difference is that bit 3 till 22 are used)
The first character of the address is specific for the button number, and that was certainly not as explained above. In my opinion, the last two bits are used for those. (or to be correct, the last two for the 4-button and just one for the 8-button)

For all buttons I own, all addresses match (To be complete, I did not double-check if the order of the 4-buttons is correct).

For the 2-buttons, Iā€™m lost. I do not have them, so I canā€™t verify.

Iā€™ve made myself an Excel file.
Please check it out so you can have a look and confirm my logic (and maybe expand to the 2-buttons.)
Some of the formulaā€™s might look complicated; (I use Excel quite often, and tend to use formulaā€™s that not everybody understands :slight_smile: )

The file contains some extra comments and details of how it works. (I hope it is clear.).

Link to Excel

(links to my OneDrive and is read only, pls let me know if you can open it.)

PS
In the end, it certainly would have been faster to do it manually, but maybe it is of some value for others and I also had some fun.

Great find! A quick note, first thing first you need you configuration file Ā« button Ā» fully completed. Why ? The integration relies on scheduled refresh and button press to get latest status.

So let say you turn on a light with a physical button and this button has no Ā« impacted module Ā« defined in the button config_file then nikobus and HA will be out of sync till next integration based module refresh.

On the feedback, you need only one of the button address that triggers the led on/off defined in the modules configuration file. So the integration will mimic a button press for the led to be turned on/off.

More details as I returnā€¦

The fact that it was out of sync was the reason I tried to update the button config file.
Regarding the Led and button address I assume it is the HA-address of the button?
I will check it out.

Kurt

if you are still busy with button definition, You could use a notification to your mobile device everytime a button is pushed. Thatā€™s how I did it, going around the house, pushing each physical button one by one and taking note of the address / purpose and then updating the config file accordingly.

alias: Nikobus Button Press
description: Perform actions when a Nikobus button is reported as pressed.
trigger:
  - platform: event
    event_type: nikobus_button_pressed
action:
  - data:
      message: "{{ trigger.event.data.address }}"
    action: notify.mobile_app_iphone

@KeMaLiPro Since you canā€™t post picture in the forum, can you PM me ? is this working ?