Push button instead of switch

We’re talking about Basic UI /Classic UI?

This is a bit tricky. The first step is to get a Push button instead of a switch:

.sitemap:

Switch item=vent_niveau_3 mappings=[ON="Click"]

To prevent the Button stay pressed, you would have to set the item like this.
.items:

Switch vent_niveau_3 "Ventilation max" (vent) {ihc="0x33c311", autoupdate="false"}

Now, you want to get another icon instead of the switched one. You can get this by using visibility.
.items:

Switch vent_niveau_3 "Ventilation max" (vent) {ihc="0x33c311", autoupdate="false"}
Switch vent_niveau_3_state "Ventilation max" (vent) {ihc="0x33c312"}

.sitemap:

Switch item=vent_niveau_3 mappings=[ON="ON"] icon="switch-off" visibility=[vent_niveau_3_state == OFF]
Switch item=vent_niveau_3 mappings=[ON="OFF"] icon="switch-on" visibility=[vent_niveau_3_state == ON]
7 Likes

Hello Udo

What I have done in situations like this is to create a new bistable switch in the IHC program and tie that to the status of the push button, so that it follows automatically. Then make openhab communicate with that new switch and you are set.

Also if you have multiple levels that are set to a numerical value in the IHC program you can write those numbers directly. That is the way I have handled multiple speeds.

If you are interested I can get the program for you when I get back from holidays.

Why you are mapping the inputs instead the outputs? You should map all the outputs, and with openhab you simply turn the on or off the output.
I only map the inputs where i’m using it in contacts or sensors.

That’s great!

Thanks for that…

How do you handle a wired dimmer by mapping it´s output ?. (ie an LK/Schneider Uni400 dimmer (IHC)).

The problem with the push buttons is a long press on the button to control the dimming level (Up/down). This is, for god knows what reason, a tricky (impossible) job for OpenHab. And I really cant firgure why this is not a standard option, just like a normal switch. I doubt we´re the only ones in the world with push buttons and have the need of long press.

I dont have any dimmer in my home, but you can debug the internal variables of the functions that handles the dimmer. When you discover the resource id simply bind the resource id with one number field in openhab. You can set one slider or one predefined percentagem using one dropdown.

Let me know if you resolve the problem,

Regards,

I´m not sure if I understood what you mean.
I have setup the switch which handle the dimmer, as an item. (its a push button). When i push the button, it turns on the light. When I push it again, it turns off the light. It works fine.
To be able to dimm the light, I have to push the button, and hold the press, and the light will dimm up or down. The problem is holdning the press in OpenHab (BasicUI or Habpanel), as the switch only send ON command according to the log.

Greets
Kim

After analizing to the function in IHC Visual for your dimmer you need to bind 2 buttons.
To dim up bind with output soft turn on
To dim down bind with output soft turn on.

You can also bind the memory level 1 and 2.

Try and give me some feedback.
Regards

Some documentation for button:
http://docs.openhab.org/configuration/sitemaps.html#element-type-switch

Hallo,
I am new with the Push button in openHAB2. I do not the idea about setting a simple push button, that when I click it shows me ON and when I release it shows me OFF through mqtt. It was just the simple button in openHAB nothing is connected to it. Can you help me to setting the Push Button with MQTT in openHAB2.?

Thank you in advance.

1 Like

I fully agree with Kim Andersen, the OpenHAB system does not fully interact with the IHC system as it is right now.

Let me give you some examples:

  1. I do not want to control the outputs directly. why not you may ask… Well because the IHC system is infact a system with inputs and outputs and a program in between the input and output which is often more complex than “if input then toggle output” there can be complex functions involved (timers, double press, calendar, AND/OR combinations etc.) and if I directly toggles an output i might very well disrupt the functions internally programmed in the HC system. Now I do not want to completely exchange my IHC system controller program for a program in the OpenHAB controller. I whish it to become an addendum to IHC controller which is compliant to the nature of IHC.

  2. Often buttons are used for more than one function. (i.e. single press/double press OR short or long press)
    same button can even be used for both dimming and turn ON/OFF a dimmer . Thus i need the OpenHAB interface to operate as is was an input to the system which can provide single press, double press, triple press, Short press and long press (and i wish to set short press & Long press times)

  3. I cannot just change my system to operate with a two button system for dimmer, I simply does not have enough inputs & outputs for this operation. MY installation have used all Inputs and outputs and this i have succededd by having one button for dimming and turning ON/OFF my 13 dimmers. so changing this setup is not an option for me.

Last let med state that I do like the OpenHAB system and see many strengths and posibilities so I’m all for having OpenHAB and IHC interact with each other. OpenHAB surely can do what IHC cant. but by enabling the above mentioned issues we could go from good to great interface to IHC

I hope that the OpenHAB system designers are reading this and wishes to solve these issues

Thanks in advance

Br
Morten Klitgaard

Hi Morten…
I´m not sure, but it may be a binding option/feature. So perhaps @pauli_anttila can do something with this in the new IHC binding. I forgot to ask him in the IHC user forum :slight_smile:

Hi Kim Andersen

How can we contact Pauli Anttila and ask him?

Through this forum or IHC forum?

Thanks in advance :slight_smile:

BR
Morten K

@pauli_anttila is active here and in the IHC user forum. Hopefully my tag will “wake him up” :smile:

Hi Udo, this works perfect, nice work-around!

Do you have an idea, how to do the same for a button in the Homekit binding?
Background: I’d like to use Siri for opening the housedoor, Electric strike is connected via KNX, Gira X1 button and (your) openhab button are running fine…

brgds
Nico

additional information: I can open the door by saying “hey Siri, open the door” but then I need to say also “hey Siri, close the door” - which is stupid with a “Türsummer” :wink:

a more convenient way would be a timer to switch off the release buzzer, like that:

rule "switch off release buzzer"
when
    Item releaseBuzzer received command ON
then
    createTimer(now.plusMillis(1000), [ |
        releaseBuzzer.sendCommand(OFF)
    ])
end

You can also use the expire Binding (v1 Addon) or use the brand new option for expire in openHAB3-M3 (not 100% sure if in milestone already… will be in the first stable release in late december))

2 Likes

Smart approach! I’ll try it and feedback

Thanks

The “switch off release buzzer” rule works also proper.

But I still have to say “Hey Siri, close the door” :upside_down_face:

Why?