Hop til indhold
  • 0

openHAB2 IHC binding


Pauli Anttila
 Share

Spørgsmål

Update 12.3.2019:

Binding has been merged to openHAB main repository and will available in 2.5 version. Before that, new version can be found from official openHAB snapshot builds.

Before official add-on documentation page is updated, binding documentation can found here.

 

NOTE. If you have used older beta versions of the binding, beware that there has been some breaking changes lately:

  • Controller address parameter is not anymore ip, but hostname
  • "-channel" suffix is removed from channel types. E.g. switch-channel is just switch.

 

###########################################################################################################################

 

Even openHAB 1 IHC binding has been rock solid for many years, I finally decided to port the binding to support openHAB 2 features.

Latest version: https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.ihc/2.4.0-SNAPSHOT/

Documentation link

Some improvements / features:

  • By default, binding create channels automatically from project file (currently all dataline_inputs, dataline_outputs, airlink_inputs, airlink_outputs and resource_temperature).
  • Auto creation can be disabled, and channels can be created manually (then all resource id's are supported).
  • Support both Paper UI and thing files configuration.
  • Channels for basic controller information (state, SW and HW version, controller uptime, etc).
  • Trigger channels support (button short press, long press and extra long press).
  • Support multiple controllers (those who have e.g. two controllers environment).

 5b000b95160a8_ScreenShot2018-05-19at14_32_14.thumb.png.4093d93247a17cd4fc3d66307c895976.png

5b000ba2cc62b_ScreenShot2018-05-19at14_33_06.thumb.png.648edf0e40855577f58e973c448514b6.png

 

Link til kommentar
Del på andre sites

Recommended Posts

  • 0
12 minutter siden, Pauli Anttila skrev:

@h.hojgaard, @Kandersen, thats great :)

I encourage all others test the lates version as well, so that I can fix all problem hopefully before openHAB 2.5 release.

I think it´s in May or June 2019 openHab 2.5 will be released.. Hopefully we´ll have all bugs fixed by then, and you can get it reviewed successfully. I follow the review process as well. 

These days I´m "converting" all my IHC items from the old binding to this new one, just as well as adding Google Home support to nearly all functions, and getting rid of the switch/push buttons I was using with the old binding. But I have lots of items to go through, and for most of them I´ll have to create channels manually. When it´s done, I hope I never have to "convert" like this again :)

Link til kommentar
Del på andre sites

  • 0

@Pauli Anttila
I´m having some difficulties with a wireless dimmer. I have linked the channel automatically to the item looking like this:
 

Dimmer sove_halogenlys_niv      "Soveværelse Dimmer niveau [%.1f %%]"      <light>      ["Lighting"]      { channel="ihc:controller:elko:output13710941", autoupdate="false" }


Telling Google to "Turn on the light at xx%", works fine.

But...
When I tell Google to "Turn ON the light". The dimmer change to 1%
When I tell Google to "Turn OFF the light". The dimmer change to 0%.

Turning on the dimmer at level 1% does not make any sense to me, to be honest. Cause when using voice commands, you can´t tell if the dimmer is turned ON, if light is set for 1% 

When I use binding 1.13 and told Google to do the same. 
"Turn ON" - The dimmer change to 100% <--   This I would prefere.
"Turn OFF" - The dimmer change to 0%

Link til kommentar
Del på andre sites

  • 0
8 minutter siden, Pauli Anttila skrev:

I agree, value should be 100. Anyhow, could you prove logs

Do you need trace log or just tail log?

9 minutter siden, Pauli Anttila skrev:

It should also be possibe to introduce level parameter for dimmer channel, which define the ON level (e.g. 80%).

I was actually thinking about suggesting this, but I didn´t want to mix up things :) It would be great to set a static ON level. 

Link til kommentar
Del på andre sites

  • 0
8 minutter siden, Pauli Anttila skrev:

I agree, value should be 100. Anyhow, could you prove logs

Do you need trace log or just tail log?

9 minutter siden, Pauli Anttila skrev:

It should also be possibe to introduce level parameter for dimmer channel, which define the ON level (e.g. 80%).

I was actually thinking about suggesting this, but I didn´t want to mix up things :) It would be great to set a static ON level. 

Link til kommentar
Del på andre sites

  • 0

@Pauli Anttila

From Tail log:
This is what happens when I ask Google to turn on wireless dimmer:
 

2019-03-16 15:06:43.249 [ome.event.ItemCommandEvent] - Item 'sove_halogenlys_niv' received command ON
2019-03-16 15:06:43.701 [vent.ItemStateChangedEvent] - sove_halogenlys_niv changed from 0 to 1

And TRACE log when asking Google to turn on wireless dimmer:
 

2019-03-16 15:10:42.551 [DEBUG] [ding.ihc.internal.handler.IhcHandler] - Received channel: ihc:controller:elko:sove_dimmer, command: ON
2019-03-16 15:10:42.556 [DEBUG] [ding.ihc.internal.handler.IhcHandler] - Channel params: [ channelTypeId=dimmer, resourceId=13710941, direction=ReadWrite, commandToReact=null, pulseWidth=null, inverted=false, serialNumber=null, longPressTime=null ]
2019-03-16 15:10:42.559 [DEBUG] [ding.ihc.internal.handler.IhcHandler] - Send command 'ON' to resource '13710941'
2019-03-16 15:10:42.561 [DEBUG] [ding.ihc.internal.handler.IhcHandler] - Update resource value (inverted output=false): [resourceId=13710941, value=1, min=0, max=100]
2019-03-16 15:10:42.871 [DEBUG] [ding.ihc.internal.handler.IhcHandler] - Received channel: ihc:controller:elko:output13710941, command: ON
2019-03-16 15:10:42.874 [DEBUG] [ding.ihc.internal.handler.IhcHandler] - Channel params: [ channelTypeId=switch, resourceId=13710941, direction=null, commandToReact=null, pulseWidth=null, inverted=false, serialNumber=null, longPressTime=null ]
2019-03-16 15:10:42.877 [DEBUG] [ding.ihc.internal.handler.IhcHandler] - Send command 'ON' to resource '13710941'
2019-03-16 15:10:42.880 [DEBUG] [ding.ihc.internal.handler.IhcHandler] - Update resource value (inverted output=false): [resourceId=13710941, value=1, min=0, max=100]
2019-03-16 15:10:42.903 [DEBUG] [org.openhab.binding.ihc.ws.IhcClient] - 2 new notifications received from controller
2019-03-16 15:10:42.918 [DEBUG] [ab.binding.ihc.internal.ws.IhcClient] - 1 new notifications received from controller
2019-03-16 15:10:42.919 [DEBUG] [ding.ihc.internal.handler.IhcHandler] - resourceValueUpdateReceived: [resourceId=13710941, value=1, min=0, max=100]
2019-03-16 15:10:42.922 [DEBUG] [ding.ihc.internal.handler.IhcHandler] - Update channel 'ihc:controller:elko:sove_dimmer' state, channel params: [ channelTypeId=dimmer, resourceId=13710941, direction=ReadWrite, commandToReact=null, pulseWidth=null, inverted=false, serialNumber=null, longPressTime=null ]
2019-03-16 15:10:42.929 [DEBUG] [ding.ihc.internal.handler.IhcHandler] - Update channel 'ihc:controller:elko:output13710941' state, channel params: [ channelTypeId=switch, resourceId=13710941, direction=null, commandToReact=null, pulseWidth=null, inverted=false, serialNumber=null, longPressTime=null ]
2019-03-16 15:10:44.340 [DEBUG] [org.openhab.binding.ihc.ws.IhcClient] - 1 new notifications received from controller

 

Link til kommentar
Del på andre sites

  • 0

Hi @Pauli Anttila

I´m almost done coverting all my items from the old 1.13 binding to the new one. Now I have run into a highly strange Google Assistant (Home) issue, i really cant explain. 

Issue is:
When I tell Google to turn on a specific light, (one lamp) Google returns with "okay, turning on 2 lamps", even though I have only tagged ONE lamp.
This happens to all my IHC items I have tagged Google Assistant. 

This is what happens in the tail log.. Notice, the items recives ON twice within aprox 300ms.. 
 

2019-03-18 22:36:29.668 [ome.event.ItemCommandEvent] - Item 'casperDimmerLys' received command ON
2019-03-18 22:36:29.967 [ome.event.ItemCommandEvent] - Item 'casperDimmerLys' received command ON
2019-03-18 22:36:30.472 [vent.ItemStateChangedEvent] - casperDimmerLys changed from OFF to ON

This is my .things file for the device:

Type switch   :casper_dimmer_fb               "Casper dimmer Trigger"              [ resourceId=12815889, direction="WriteOnly", pulseWidth=100 ]
Type switch   :casper_dimmer_state            "Casper dimmer state"                [ resourceId=12818962, direction="ReadOnly" ]

And this is my item for the things:

Switch casperDimmerLys 	"Loftlys i Caspers værelse [%s]"   <light> 	[ "Lighting" ] 	  { channel="ihc:controller:elko:casper_dimmer_fb", channel="ihc:controller:elko:casper_dimmer_state", autoupdate="false" }

I say:
"Hey Google turn on Loftlys i Caspers værelse"
Google respond:
"Okay, turning on 2 lamps". 
And the light turns on. 

This happens to all my IHC items I have tagged Google Assistant. 
I´m pretty possitive (99% sure) this didnt happen yesterday and the day before yesterday, because while converting all my items to the new binding, I made quite a few test after each item, to be sure they worked.. Now I have no idea how to troubble-shoot this issue.. When I use REST to list the items with the "Lighting" tag, this is the result:
 

[
{"link":"https://home.myopenhab.org:443/rest/items/bryggers_DimmerLys","state":"OFF","stateDescription":{"pattern":"%s","readOnly":false,"options":[]},"editable":false,"type":"Switch","name":"bryggers_DimmerLys","label":"Bryggers Halogenlys","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/bryggers_Skablys","state":"OFF","stateDescription":{"pattern":"%s","readOnly":false,"options":[]},"editable":false,"type":"Switch","name":"bryggers_Skablys","label":"Bryggers Skablys","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/lille_bad_OEV","state":"OFF","stateDescription":{"pattern":"%s","readOnly":false,"options":[]},"editable":false,"type":"Switch","name":"lille_bad_OEV","label":"Lille Bad Lys","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/spise_halo_styrke","state":"0","stateDescription":{"pattern":"%s %%","readOnly":false,"options":[]},"editable":false,"type":"Dimmer","name":"spise_halo_styrke","label":"Spotlys ved spiseplads","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/kontor","state":"ON","stateDescription":{"pattern":"%s","readOnly":false,"options":[]},"editable":false,"type":"Switch","name":"kontor","label":"Loftlys i kontoret","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/koekken_underskablys_niv","state":"0","stateDescription":{"pattern":"%.0f %%","readOnly":false,"options":[]},"editable":false,"type":"Dimmer","name":"koekken_underskablys_niv","label":"Lyset under køkkenskabe","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/amanda_OEV","state":"OFF","stateDescription":{"pattern":"%s","readOnly":false,"options":[]},"editable":false,"type":"Switch","name":"amanda_OEV","label":"Lampeudtag i Amandas værelse","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/amanda_OEH","state":"OFF","stateDescription":{"pattern":"%s","readOnly":false,"options":[]},"editable":false,"type":"Switch","name":"amanda_OEH","label":"Spotlys i Amandas værelse","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/sove_lampeudtaglys","state":"OFF","stateDescription":{"readOnly":false,"options":[]},"editable":false,"type":"Switch","name":"sove_lampeudtaglys","label":"Lampeudtag i soveværelset","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/garage_lys","state":"OFF","stateDescription":{"pattern":"%s","readOnly":false,"options":[]},"editable":false,"type":"Switch","name":"garage_lys","label":"Garage Loftlys","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/garage_ydoer","state":"OFF","stateDescription":{"pattern":"%s","readOnly":false,"options":[]},"editable":false,"type":"Switch","name":"garage_ydoer","label":"Garage lys konstant","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/aktivitetUBeboet","state":"ON","stateDescription":{"pattern":"","readOnly":false,"options":[]},"editable":false,"type":"Switch","name":"aktivitetUBeboet","label":"Ubeboet tilstand","category":"cu_switch","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/spise_bord_niv","state":"0","stateDescription":{"pattern":"%s %%","readOnly":false,"options":[]},"editable":false,"type":"Dimmer","name":"spise_bord_niv","label":"Lyset over spisebord","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/stue_sov_OEH","state":"OFF","stateDescription":{"pattern":"%s","readOnly":false,"options":[]},"editable":false,"type":"Switch","name":"stue_sov_OEH","label":"Stue M2","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/lys_haven","state":"OFF","stateDescription":{"pattern":"%s","readOnly":false,"options":[]},"editable":false,"type":"Switch","name":"lys_haven","label":"Lyset i haven","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/marc_OEH","state":"OFF","stateDescription":{"pattern":"%s","readOnly":false,"options":[]},"editable":false,"type":"Switch","name":"marc_OEH","label":"Spotlys i Marcs værelse","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/marc_OEV","state":"OFF","stateDescription":{"pattern":"%s","readOnly":false,"options":[]},"editable":false,"type":"Switch","name":"marc_OEV","label":"Lampeudtag i Marcs værelse","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/stue_sov_OEV","state":"OFF","stateDescription":{"pattern":"%s","readOnly":false,"options":[]},"editable":false,"type":"Switch","name":"stue_sov_OEV","label":"Stue M1","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/sove_halogenlys_niv","state":"0","stateDescription":{"pattern":"%.0f %%","readOnly":false,"options":[]},"editable":false,"type":"Dimmer","name":"sove_halogenlys_niv","label":"Spotlys i soveværelset","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/casperDimmerLys","state":"ON","stateDescription":{"pattern":"%s","readOnly":false,"options":[]},"editable":false,"type":"Switch","name":"casperDimmerLys","label":"Loftlys i Caspers værelse","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/stort_badDimmerLys","state":"OFF","stateDescription":{"pattern":"%s","readOnly":false,"options":[]},"editable":false,"type":"Switch","name":"stort_badDimmerLys","label":"Halogenlys i StortBad","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/aktivitetLysKonstant","state":"OFF","stateDescription":{"pattern":"%s","readOnly":false,"options":[]},"editable":false,"type":"Switch","name":"aktivitetLysKonstant","label":"Konstantlys i aktivitetrum","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/aktivitet_halo_styrke","state":"0","stateDescription":{"pattern":"%s %%","readOnly":false,"options":[]},"editable":false,"type":"Dimmer","name":"aktivitet_halo_styrke","label":"Spotlys i aktivitetrum","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/koekken_vasklys_niv","state":"30","stateDescription":{"pattern":"%.0f %%","readOnly":false,"options":[]},"editable":false,"type":"Dimmer","name":"koekken_vasklys_niv","label":"Lyset ved køkkenvask","category":"light","tags":["Lighting"],"groupNames":[]},
{"link":"https://home.myopenhab.org:443/rest/items/aktivitetBeboet","state":"OFF","stateDescription":{"pattern":"","readOnly":false,"options":[]},"editable":false,"type":"Switch","name":"aktivitetBeboet","label":"Beboet tilstand","category":"cu_switch","tags":["Lighting"],"groupNames":[]}
]

I have tried restart openhab. I have cleard cache and tmp, and restarted. It´s still an issue.. 
Do you have any idea how to trouble-shoot this issue?

EDIT:
It may be a Google/openhab issue as I suddenly remember I made a sligt mistake in the last item I changed..
I have asked Memeth for help in the openhab community:
https://community.openhab.org/t/official-google-assistant-integration-for-openhab/40425/827?u=kim_andersen
 

Link til kommentar
Del på andre sites

  • 0

@Kandersen, I guess that this is not ihc binding problem, but related to google home or openhab core. 

 

2019-03-18 22:36:29.668 [ome.event.ItemCommandEvent] - Item 'casperDimmerLys' received command ON
2019-03-18 22:36:29.967 [ome.event.ItemCommandEvent] - Item 'casperDimmerLys' received command ON
2019-03-18 22:36:30.472 [vent.ItemStateChangedEvent] - casperDimmerLys changed from OFF to ON

Two ON commands are logged by the openHAB framework, so even if you remove ihc binding you should see the same.

Link til kommentar
Del på andre sites

  • 0
3 timer siden, Pauli Anttila skrev:

@Kandersen, I guess that this is not ihc binding problem, but related to google home or openhab core. 

 


2019-03-18 22:36:29.668 [ome.event.ItemCommandEvent] - Item 'casperDimmerLys' received command ON
2019-03-18 22:36:29.967 [ome.event.ItemCommandEvent] - Item 'casperDimmerLys' received command ON
2019-03-18 22:36:30.472 [vent.ItemStateChangedEvent] - casperDimmerLys changed from OFF to ON

Two ON commands are logged by the openHAB framework, so even if you remove ihc binding you should see the same.

Agree, this is not a IHC binding issue.. It´s surely a openhab/google issue, (probably Google issue). An noone seems to know the reason, and it´s difficult to troubble-shoot as well.

Link til kommentar
Del på andre sites

  • 0
På 16.3.2019 at 14:44 , Pauli Anttila skrev:

@Kandersen, I agree, value should be 100. Anyhow, could you prove logs. It should also be possibe to introduce level parameter for dimmer channel, which define the ON level (e.g. 80%).

Hi Pauli..
Will any of these features be included into the binding? (either the 100 or option to set a static level).

Link til kommentar
Del på andre sites

  • 0
59 minutter siden, Pauli Anttila skrev:

@Kandersen, I’m currently travelling, so I will fix that near future (after week or so).

@Pauli Anttila Great, really looking forward to that. I´m done "converting" all my stuff from the old 1.13 binding to the new. Old binding is uninstalled :)

Hopefully you´re travelling on vacation :D

Link til kommentar
Del på andre sites

  • 0
På 19.3.2019 at 00:22 , Kandersen skrev:

Ignore the above Google Assistant issue.. I got it fixed. Had to remove the openhab link to Google Assistant and re-add it again. After that its working fine again. 
Guess this was just some weird Google thing!!

EDIT - And now I´m back to having this issue again :angry:

@Kandersen try to tell your google assistent "Synkroniser mine enheder" everytime you do changes to OpenHAB config.

Link til kommentar
Del på andre sites

  • 0

@Kandersen, the fixes are now merged to main repo. I also fixed the Dimmer ON command bug. Binding now set Dimmer to 100 when ON command is received. In fact, binding set resource to resource max value by ON command and to resource min value by OFF command. Dimmer min is 0 and max is 100, but some other resources min and max could be something else. I didn't introduce configurable level yet. 

Link til kommentar
Del på andre sites

  • 0

@Pauli Anttila sounds great..
Could you please upload the .jar as well. From the community of Openhab there are rumors that the next merge will not happen until 60 days or so, due to some changes in the ESH etc.. (I dont really know what it is, but these days nothing gets merged as far as I understand, untill openhab developers have moved everything from ESH to openhab).

Link til kommentar
Del på andre sites

  • 0

Changes are merged, so latest official snapshot should be ok.

Yes, I'm aware of what is happening on development side pretty well. Latest 7 years, I have developed over 10 OH1 bindings, 8 OH2 bindings (+2 is in pipeline), several transformation services and countless amount of improvements and bug fixes to many other bindings and core features.

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