Hop til indhold
  • 0

OpenHAB binding


Pauli Anttila
 Share

Spørgsmål

Hi All,this forum has been very useful for me, so like it to inform that I have recently developed OpenHAB binding for IHC / ELKO LS controller. I not understand a word in Danish, but luckily google translator works very well :)OpenHAB is open source home automation system. I discovered OpenHAB half an year ago, when I researched system to expand my current IHC system. OpenHAB is based on OSGi and it's looks very promising.Codes are already available on OpenHAB clone's repository, but If there are any interest I can post pre builded binding as well and some information how to configure the binding.Regards,Pali

Link til kommentar
Del på andre sites

Recommended Posts

  • 0

I'm positive the ip is correct, I've recently updated the firmware to the New beta firmware. Do you Think that could have anything to dk with it?

 

Hopefully not. If google translated correctly your earlier post, you successfully connected openhab to controller on mac mini? If yes, was your controller already on new beta version?

 

-Pali

Link til kommentar
Del på andre sites

  • 0

Does anyone know how to make rules to convert time so it can be send to IHC? I try to send sunset and sunrise to IHC, but openhab comes with an error, it can not convert time. I have tried two different ways, one is downloading the times from wunderground, and I found a rule that calculate the

time but it doesn't work either. I don't know much about Java, so I haven't been able to figure out how to convert it or split it.

DateTime SunSet "Sunset [%1$tH:%1$tM:%1$tS]" <clock> (date,SunTime1) {ihc=">4885261"}

DateTime SunRise "SunRise [%1$tH:%1$tM:%1$tS]" <clock> (date,SunTime1) {ihc=">4885517"}

String strSunset "strSunset [ %s ] " <clock> (date,SunTime1) { http="<[http://api.wunderground.com/api/xxxxxxxxxxxxxxxx/astronomy/q/DK/kolding.xml:600000:XSLT(wunderground_sunset.xsl)]",ihc=">4885261"}

String strSunrise "strSunrise [ %s ] " <clock> (date,SunTime1) { http="<[http://api.wunderground.com/api/xxxxxxxxxxxxxxxx/astronomy/q/DK/kolding.xml:600000:XSLT(wunderground_sunrise.xsl)]",ihc=">4885517"}

2014-11-09 21:34:37 - Sunset_Time2 state updated to 4:24 pm

2014-11-09 21:35:00 - SunRise state updated to 2014-11-09T07:45:08

2014-11-09 21:35:00 - SunSet state updated to 2014-11-09T16:25:18

2014-11-09 21:35:22 - strSunrise state updated to 7:43:00

2014-11-09 21:35:28 - Sunrise_Time2 state updated to 7:39 am

2014-11-09 21:35:33 - strSunset state updated to 16:27:00

21:29:36.249 ERROR o.o.b.ihc.internal.IhcBinding[:426]- Error occured during item update

java.lang.NumberFormatException: Can't convert class org.openhab.core.library.types.DateTimeType

at org.openhab.binding.ihc.internal.IhcDataConverter.convertCommandToResourceValue(IhcDataConverter.java:416)

at org.openhab.binding.ihc.internal.IhcBinding.updateResource(IhcBinding.java:411)

at org.openhab.binding.ihc.internal.IhcBinding.internalReceiveUpdate(IhcBinding.java:358)

at org.openhab.core.binding.AbstractBinding.receiveUpdate(AbstractBinding.java:117)

at org.openhab.core.events.AbstractEventSubscriber.handleEvent(AbstractEventSubscriber.java:38)

at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)

21:29:39.381 ERROR o.o.b.ihc.internal.IhcBinding[:426]- Error occured during item update

java.lang.NumberFormatException: Can't convert class org.openhab.core.library.types.DateTimeType

at org.openhab.binding.ihc.internal.IhcDataConverter.convertCommandToResourceValue(IhcDataConverter.java:416)

at org.openhab.binding.ihc.internal.IhcBinding.updateResource(IhcBinding.java:411)

at org.openhab.binding.ihc.internal.IhcBinding.internalReceiveUpdate(IhcBinding.java:358)

at org.openhab.core.binding.AbstractBinding.receiveUpdate(AbstractBinding.java:117)

at org.openhab.core.events.AbstractEventSubscriber.handleEvent(AbstractEventSubscriber.java:38)

at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)

21:30:01.142 ERROR o.o.b.ihc.internal.IhcBinding[:426]- Error occured during item update

java.lang.NumberFormatException: Can't convert class org.openhab.core.library.types.DateTimeType

at org.openhab.binding.ihc.internal.IhcDataConverter.convertCommandToResourceValue(IhcDataConverter.java:416)

at org.openhab.binding.ihc.internal.IhcBinding.updateResource(IhcBinding.java:411)

at org.openhab.binding.ihc.internal.IhcBinding.internalReceiveUpdate(IhcBinding.java:358)

at org.openhab.core.binding.AbstractBinding.receiveUpdate(AbstractBinding.java:117)

at org.openhab.core.events.AbstractEventSubscriber.handleEvent(AbstractEventSubscriber.java:38)

at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)

21:30:01.199 ERROR o.o.b.ihc.internal.IhcBinding[:426]- Error occured during item update

java.lang.NumberFormatException: Can't convert class org.openhab.core.library.types.DateTimeType

at org.openhab.binding.ihc.internal.IhcDataConverter.convertCommandToResourceValue(IhcDataConverter.java:416)

at org.openhab.binding.ihc.internal.IhcBinding.updateResource(IhcBinding.java:411)

at org.openhab.binding.ihc.internal.IhcBinding.internalReceiveUpdate(IhcBinding.java:358)

at org.openhab.core.binding.AbstractBinding.receiveUpdate(AbstractBinding.java:117)

at org.openhab.core.events.AbstractEventSubscriber.handleEvent(AbstractEventSubscriber.java:38)

at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)

Link til kommentar
Del på andre sites

  • 0

Hi Frank,

 

which openhab version you are using, because exception message is not from current version?

 

IHC binding support DateTime data types, but because date and time are separated variable on IHC side, you need to introduce both resource values WSDateValue and WSTimeValue to openhab item. See more from ihc binding wiki page.

 

example, where 111112 is resource_time id from ihc project file and 111113 is resource_date id: 

DateTime SunSet "Sunset [%1$tH:%1$tM:%1$tS]" <clock> (date,SunTime1) {ihc=">111112", ihc=">111113"}
 

I personally use astro binding (openhab 1.5) to calculate sun set and rise times (https://github.com/openhab/openhab/wiki/Astro-binding), and openhab rules to handle sunset and sunrise events. 

 

But if you need to have times on ihc side as well, Item definition example with astro binding should be (not tested)

DateTime Sunrise_Time   "Sunrise [%1$tH:%1$tM]"  {astro="type=SUNRISE_TIME", ihc=">111112", ihc=">111113"}

 

-Pali

Link til kommentar
Del på andre sites

  • 0

I see.. Well now i just got openhab up and running on my mac yosemite..

I transferred the certificate with keytool and here is what I get when i try to connect to the controller

 

19:43:04.743 DEBUG o.o.binding.ihc.ws.IhcClient[:170] - Close connection

19:43:04.743 INFO  o.o.b.ihc.internal.IhcBinding[:151] - Connecting to IHC / ELKO LS controller [iP=10.0.1.30' Username='admin' Password='******].

19:43:04.744 DEBUG o.o.binding.ihc.ws.IhcClient[:189] - Open connection

19:43:04.744 DEBUG o.o.b.i.w.IhcAuthenticationService[:41] - Open connection

^X^C19:43:07.356 INFO  o.o.io.rest.RESTApplication[:159] - Stopped REST API

19:43:07.356 DEBUG o.o.i.s.i.DiscoveryServiceImpl[:57] - Unregistering service _openhab-server._tcp.local. at port 8080

19:43:08.450 WARN  o.o.b.ihc.internal.IhcBinding[:200] - Can't open connection to controller

org.openhab.binding.ihc.ws.IhcExecption: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake

at org.openhab.binding.ihc.ws.IhcHttpsClient.sendQuery(IhcHttpsClient.java:182)

at org.openhab.binding.ihc.ws.IhcAuthenticationService.authenticate(IhcAuthenticationService.java:57)

at org.openhab.binding.ihc.ws.IhcClient.openConnection(IhcClient.java:194)

at org.openhab.binding.ihc.internal.IhcBinding.connect(IhcBinding.java:158)

at org.openhab.binding.ihc.internal.IhcBinding.execute(IhcBinding.java:196)

at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:156)

at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:173)

Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake

at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)

at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1343)

at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1371)

at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1355)

at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)

at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)

at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1281)

at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1256)

at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)

at org.openhab.binding.ihc.ws.IhcHttpsClient.sendQuery(IhcHttpsClient.java:166)

at org.openhab.binding.ihc.ws.IhcAuthenticationService.authenticate(IhcAuthenticationService.java:57)

Caused by: java.io.EOFException: SSL peer shut down incorrectly

at sun.security.ssl.InputRecord.read(InputRecord.java:505)

at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:954)

at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1343)

at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1371)

at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1355)

at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)

at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)

at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1281)

at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1256)

at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)

at org.openhab.binding.ihc.ws.IhcHttpsClient.sendQuery(IhcHttpsClient.java:166)

19:43:09.369 DEBUG o.o.i.s.i.DiscoveryServiceImpl[:57] - Unregistering service _openhab-server-ssl._tcp.local. at port 8443

19:43:09.454 DEBUG o.o.binding.ihc.ws.IhcClient[:170] - Close connection

19:43:09.455 INFO  o.o.b.ihc.internal.IhcBinding[:151] - Connecting to IHC / ELKO LS controller [iP=10.0.1.30' Username='admin' Password='******].

19:43:09.455 DEBUG o.o.binding.ihc.ws.IhcClient[:189] - Open connection

19:43:09.455 DEBUG o.o.b.i.w.IhcAuthenticationService[:41] - Open connection

19:43:10.394 WARN  o.o.b.ihc.internal.IhcBinding[:200] - Can't open connection to controller

 

To me it looks identical to the data on my windows laptop..

 

I came to think if it had anything to do with me not having a "Viewer Controller" ?

I must have to add that MikkelS' "Captain" does work with no problems at all.

Redigeret af Esben Uth
Link til kommentar
Del på andre sites

  • 0

Hi Pali

I think the version I was running was a mix between 1.4 and 1.5.1 because I had synchronised my raspberry with an older version. Now I have deleted

all files and synchronised it again, now it should run 1.5.1. I am still not able to send sunset time to ihc. I have just added date input to ihc

function and added astro binding to openhab and sended the way you advised me, but it is still not working. I am not able to read the time and the

date from ihc the way you describe, I am only able to read time or date. Thank you for a great work, sorry for bothering you with dumb questions.

DateTime Sunrise_Time "Sunrise [%1$tH:%1$tM:%1$tS]" <clock> (date,SunTime1) {astro="type=SUNRISE_TIME",ihc=">0x4aa20e",ihc=">0x4a8c0d"}

DateTime Sunset_Time "Sunset [%1$tH:%1$tM:%1$tS]" <clock> (date,SunTime1) {astro="type=SUNSET_TIME",ihc=">0x4a9b0e",ihc=">0x4a8b0d"}

DateTime IHCtimeT "IHCtimeTænd [%1$td.%1$tm.%1$tY %1$tH:%1$tM:%1$tS ] " <clock> (date,SunTime1) { ihc="4889358",ihc="4885517" }

DateTime IHCtimeS "IHCtimeSluk [%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS ] " <clock> (date,SunTime1) { ihc="4891150",ihc="4885261" }

<functionblock id="_0x371c28" name="fp 1.0 7 dages ur, med 1 tænd tidspunkt" master_name="fgp 1.0 7 dages ur, med 1 tænd tidspunkt" master_programmer="Frank" master_date_year="2014" master_date_month="11" master_date_day="11" locked="yes" icon="_0x10" note="2.1.01.a. 7 dages ur, med 1 tænd tidspunkt Anvendelse: 7 dages ur, hvor der kun er et tænd- og sluktidspunkt. Dvs. at alle ugens 7 dage har samme tænd- og sluktidspunkt. For at se den fulde beskrivelse marker denne linje og tryk "F1". Bemærk: Dette virker kun hvis "Blokken" er rød-markeret !">

<inputs id="_0x371d23" name="Input" icon="_0x4" note="Variablene i denne gruppering er input til funktionsblokken">

<resource_input id="_0x371e11" name="Tryk (manuel overstyring)" icon="_0x36" note="Manuelt overstyring af ur - En aktivering vil skifte udgangen. Udgang for ur vil forblive i tilstanden indtil næste urtidspunkt. (Udfyldes af installatøren)"/>

<resource_time id="_0x4a8b0d" name="Tidspunkt Tænd" icon="_0x2f" hour="0" minute="0" second="0"/>

<resource_time id="_0x4a8c0d" name="Tidspunkt Sluk" icon="_0x2f" hour="0" minute="0" second="0"/>

<resource_date id="_0x4a9b0e" name="Dato Tidspunkt Tænd" icon="_0x29" year="2000" month="7" day="7"/>

<resource_date id="_0x4aa20e" name="Dato Tidspunkt Sluk" icon="_0x29" year="2000" month="6" day="8"/>

</inputs>

java.lang.NumberFormatException: For input string: "0x4aa20e"

at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)

at java.lang.Integer.parseInt(Integer.java:492)

at java.lang.Integer.parseInt(Integer.java:527)

at org.openhab.binding.ihc.internal.IhcGenericBindingProvider.processBindingConfiguration(IhcGenericBindingProvider.java:102)

at org.openhab.model.item.internal.GenericItemProvider.internalDispatchBindings(GenericItemProvider.java:341)

at org.openhab.model.item.internal.GenericItemProvider.internalDispatchBindings(GenericItemProvider.java:317)

00:09:16.363 INFO o.o.b.a.i.job.JobScheduler[:101]- Deleting astro job: DayInfoJob

00:09:16.387 INFO o.o.b.a.i.job.JobScheduler[:144]- Scheduled a daily job at midnight for astro DayInfo calculation

00:09:16.404 WARN o.o.b.a.i.job.JobScheduler[:90]- Azimuth/Elevation binding available, but configuration is disabled (interval = 0)!

00:09:21.498 INFO o.o.m.c.i.ModelRepositoryImpl[:97]- Refreshing model 'fgp.items'

00:09:22.051 ERROR o.o.m.c.i.f.FolderObserver[:105]- An unexpected exception has occured

java.lang.NumberFormatException: For input string: "0x4aa20e"

at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)

at java.lang.Integer.parseInt(Integer.java:492)

at java.lang.Integer.parseInt(Integer.java:527)

at org.openhab.binding.ihc.internal.IhcGenericBindingProvider.processBindingConfiguration(IhcGenericBindingProvider.java:102)

at org.openhab.model.item.internal.GenericItemProvider.internalDispatchBindings(GenericItemProvider.java:341)

at org.openhab.model.item.internal.GenericItemProvider.internalDispatchBindings(GenericItemProvider.java:317

2014-11-13 00:03:19 - Weather_TempeIHC state updated to 10.00

2014-11-13 00:03:20 - Sunrise_Time state updated to 2014-11-13T07:52:00

2014-11-13 00:03:30 - Light_GF_Kitchen_Table state updated to ON

Link til kommentar
Del på andre sites

  • 0

Hi Frank,

 

there seems to a stupid bug on the binding. 0x prefix does not work when ">" is used. So could you try with decimal numbers.

DateTime Sunrise_Time "Sunrise [%1$tH:%1$tM:%1$tS]" <clock> (date,SunTime1) {astro="type=SUNRISE_TIME", ihc=">4891150", ihc=">4885517"}

I will fix 0x prefix problem soon (hopefully before v1.6 will be released).

 

To read date and time from IHC controller is little bit more tricky. You definition 

DateTime IHCtimeS "IHCtimeSluk [%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS ] " <clock> (date,SunTime1) { ihc="4891150", ihc="4885261" }

does not work correctly, because binding will update item "IHCtimeS" independently from both date and time resource values, so when time change it will override the date part and vice verse. Currently only possibility to read full date and time from IHC controller is introduce two items and combine them via openhab rule.

 

DateTime IHCtime { ihc="4891150" }

DateTime IHCdate { ihc="4885261" }

DateTime IHCTimeDate "IHCtimeSluk [%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS ] " <clock> (date,SunTime1)

 

Rule idea:

 

rule "Date and time merge"
when
   Item IHCtime changed or 
   Item IHCdate changed
then
   // Merge time and date and post update to IHCTimeDate
   postUpdate(IHCTimeDate, ...)

end 

 

 

Link til kommentar
Del på andre sites

  • 0

Hi Esben,

 

most probably your problem is related to Java rather than openhab or IHC binding itself. You could try add 

-Djavax.net.debug=all

parameter to openhab startup script and see if debug give you a hint why handshake fails. See more details e.g. from https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https

 

-Pali

Link til kommentar
Del på andre sites

  • 0

Hi Esben,

 

most probably your problem is related to Java rather than openhab or IHC binding itself. You could try add 

-Djavax.net.debug=all
parameter to openhab startup script and see if debug give you a hint why handshake fails. See more details e.g. from https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https

 

-Pali

Thanks Pali.

I'll try it when I get home from work :)

Link til kommentar
Del på andre sites

  • 0

Hi Frank,

 

I tested DateTime data type and multiple resource id's and it seems that it does not work like I think it should work. Only one resource id per item is supported. Additionally there was one bug introduced on ihc binding refactoring (v1.5) and also current date and time conversions doesn't work on java 7 anymore.

 

I just fixed date and time conversions, so they should work fine. But because only one resource id could be intruded per item, you need to handle that by openhab rules as well.

 

So when with latest ihc binding is released, following should work

 

DateTime Sunrise_Time "Sunrise [%1$tH:%1$tM:%1$tS]" <clock> (date,SunTime1) {astro="type=SUNRISE_TIME"}

DateTime Sunrise_Time_Date {ihc=">111111"}

DateTime Sunrise_Time_Time {ihc=">222222"}

 

Rule:

 

rule "Send Sunrise to IHC"
when
   Item Sunrise_Time received update
then
   postUpdate(Sunrise_Time_DateSunrise_Time.state)
   postUpdate(Sunrise_Time_TimeSunrise_Time.state)
end 
Link til kommentar
Del på andre sites

  • 0

I don't know if you are aware about it is quite easy to find the decimal numbers, if you go in to LK IHC visual and hold control down and drag the mouse down ower the input then the decimal shows up.  

 

In fact, I didn't know that. I have always find resource id's from project file. That's really good info to add openhab's wiki page.

 

BTW, last night snapshot build contains all the latest fixes. If you wan't to test it, It's enough to just update ihc binding from 1.6 snapshot build.

Link til kommentar
Del på andre sites

  • 0

Hi,

 

I have a question in relation to using OpenHAB and the IHC binding with two controllers. I have a rather large installation with two IHC controllers. I would like to have them both connected to OpenHAB. Is there any for doing so?

 

Thank you in advance.

 

Currently OpenHAB IHC binding support directly only one controller. But what you can do, is to install two openhab instances (in same hardware or separated). Another openhab instance is "slave" which only have ihc binding and another instance which contains also ihc binding and all others. Then you can connect both openhab instances event bus together via MQTT binding. You also need MQTT broker (e.g.  Mosquitto). I haven't tested it my self, but I know that someone have multiple openhab instances linked together in that way (try to find more information from openhab forum).

 

I'm currently porting openhab bindings to openhab2, and there multiple controllers should be supported (new openhab framework allows it without extra work).

 

-Pali

Link til kommentar
Del på andre sites

  • 0

Hey Pauli.

 

Just reinstalled my mac mini and are trying to get the openhab with ihc binding up and running.

 

Are you still running the java 7, re 1.7.0? I feel like i'm having troubles installing it on my mac.

 

Just stumpled upon this thread https://github.com/openhab/openhab/issues/2322

 

I have tried your snapshot and added the line to my cfg file. Openhab versus ihc works perfectly with this. I'm running it with java 7 though. I'll try it out with 8 tomorrow :)

Link til kommentar
Del på andre sites

  • 0

Maybe a simple question :-) I have a lot of unused wireless IHC buttons. I would like to use the buttons in openhab but every time i press the button openhab quickly turns the item ON and OFF. Do I need to put in a special function block or do i use the wrong ID ?

 

From the Debug log

22:05:35.638 [DEBUG] [enhab.binding.ihc.ws.IhcClient:496  ] - 2 new notifications received from controller

22:05:35.638 [iNFO ] [runtime.busevents             :26   ] - switch_entre_NH state updated to ON
22:05:35.826 [DEBUG] [enhab.binding.ihc.ws.IhcClient:496  ] - 2 new notifications received from controller
22:05:35.826 [iNFO ] [runtime.busevents             :26   ] - switch_entre_NH state updated to OFF

 

Items File

Switch switch_entre_NH "Entre" {ihc="0x16205c"}

 

From IHC Config file

<product_airlink id="_0x161a54" product_identifier="_0x4103" device_type="_0x802" name="Tryk 6 tast" serialnumber="_0x640214250275" locked="yes" enduser_report="yes" position="Ved hoveddør" icon="_0x85">            <airlink_input id="_0x161b5c" name="Tryk (øverst venstre)" address_channel="_0x1">               <link_from_resource id="_0x6242d" name="Følg Link" icon="_0x47" link="_0x6252c"/>            </airlink_input>            <airlink_input id="_0x161c5c" name="Tryk (øverst højre)" address_channel="_0x2"/>            <airlink_input id="_0x161d5c" name="Tryk (midt venstre)" address_channel="_0x3"/>            <airlink_input id="_0x161e5c" name="Tryk (midt højre)" address_channel="_0x4"/>            <airlink_input id="_0x161f5c" name="Tryk (nederst venstre)" address_channel="_0x5"/>            <airlink_input id="_0x16205c" name="Tryk (nederst højre)" address_channel="_0x6">            </airlink_input>         </product_airlink>
Link til kommentar
Del på andre sites

  • 0

Hi Terkild,

 

you setup is working like expected, switch_entre_NH  is ON as long you hold the button down? What do you want to do with the buttons? Below is simple openhab rule to handle button press (start and stop Sonos player).

 

 

rule "control livingroom sonos player"

     when
          Item switch_entre_NH changed to ON
     then
         if (livingroom_sonos_play.state == ON) {
               sendCommand(livingroom_sonos_play, OFF)
         } else {
               sendCommand(livingroom_sonos_play, ON)
         }
     end
 
Link til kommentar
Del på andre sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gæst
Svar på dette spørgsmål

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loader...
 Share

×
×
  • Tilføj...

Important Information

Privatlivspolitik og We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

1200x630bb.png

ok