Hop til indhold
  • 0

Openhab2, hvad er det jeg overser ?


LarsC
 Share

Spørgsmål

Hej,

Jeg er ved at lave min OH2 om til at bruge den nye binding.

I den forbindelse har jeg dog lidt udfordringer med at få den til at skrive en værdi ind i IHC som jeg modtager fra en mqtt besked.

Når jeg sætter en værdi i paperUI, så opdaterer den fint ind i controlleren.

Når der kommer en ny besked fra mqtt, så bliver værdien fint ændret igen i OH, men den kommer bare ikke videre til IHC.

 

Så det er lidt som om at den mangler en trigger når værdien kommer fra mqtt ?

 

things:

    Channels:
        Type number-channel                : temp_kontor  "Temperatur Kontor"          [ resourceId=4263700, direction="WriteOnly" ]

items:

Number Temperature_Kontor "Temperatur Kontor [%.1f °C]" <temperature> [ "CurrentTemperature" ] { channel="mqtt:topic:b5bd6b00:kontor", channel="ihc:controller:elko:temp_kontor" }

Link til kommentar
Del på andre sites

24 svar på dette spørgsmål

Recommended Posts

  • 0
1 time siden, Kandersen skrev:

Jeg har ikke selv prøvet det den vej. Men er du sikker på du skal bruge number og ikke string? Og så fange værdien fra mqtt som string? Jeg synes jeg kan huske noget med, at mqtt operere med strings.. Men jeg kan ikke huske det præcist. 

Værdierne fra mqtt kommer fint ind i mine items, og det samme kan jeg få mine ihc værdier til.

Men udfordringen er at få dem sendt til ihc igen.

Hvis jeg i paperUI blot trykker på 'ok' på værdien efter mqtt har opdateret den, så bliver den fint sent til ihc.

 

Så den opdatere min item, men får den ikke afsendt til ihc ved opdateringen.

Link til kommentar
Del på andre sites

  • 0
18 minutter siden, Kandersen skrev:

Nu er jeg forvirret.. Hvor trykker du ok?

I paperUI under control, der kan jeg se mine temperaturer, og de bliver fiont opdateret her, fra mqtt.

Når jeg trykker ok på den, så bliver værdien sent til ihc som den skal.

 

Alt dette sker bare ikke automatisk

Link til kommentar
Del på andre sites

  • 0

Måske du skal hive Pauli ind i debatten og høre ham, (på engelsk). Jeg har ikke så meget erfaring med at skrive til IHC controlleren fra en anden item, udover hvis det er via en rule. 
Og jeg undre mig vildt over, at det virker som du beskriver via PaperUI control panel. 

Det tætteste jeg kommer fra IHC bindingens doc, det er denne:
 

Type number-channel                : readonly_resource   "Read only resource"  [ resourceId=1212121, direction="ReadOnly" ]
        Type number-channel                : write1_resource     "Write 1 resource"    [ resourceId=1111111, direction="WriteOnly", commandToReact="1", pulseWidth=300 ]
        Type number-channel                : write2_resource     "Write 2 resource"    [ resourceId=2222222, direction="WriteOnly", commandToReact="2", pulseWidth=300 ]
        Type number-channel                : write3_resource     "Write 3 resource"    [ resourceId=3333333, direction="WriteOnly", commandToReact="3", pulseWidth=300 ]
Number multi_resource_test  "Multi resource test"  { channel="ihc:controller:elko:readonly_resource", channel="ihc:controller:elko:write1_resource", channel="ihc:controller:elko:write2_resource", channel="ihc:controller:elko:write3_resource" }

Men det er vel i realiteten også sådan du har gjort det, bortset fra at du læser fra mqtt..  

Link til kommentar
Del på andre sites

  • 0
32 minutter siden, Kandersen skrev:

Måske du skal hive Pauli ind i debatten og høre ham, (på engelsk). Jeg har ikke så meget erfaring med at skrive til IHC controlleren fra en anden item, udover hvis det er via en rule. 
Og jeg undre mig vildt over, at det virker som du beskriver via PaperUI control panel. 

Det tætteste jeg kommer fra IHC bindingens doc, det er denne:
 


Type number-channel                : readonly_resource   "Read only resource"  [ resourceId=1212121, direction="ReadOnly" ]
        Type number-channel                : write1_resource     "Write 1 resource"    [ resourceId=1111111, direction="WriteOnly", commandToReact="1", pulseWidth=300 ]
        Type number-channel                : write2_resource     "Write 2 resource"    [ resourceId=2222222, direction="WriteOnly", commandToReact="2", pulseWidth=300 ]
        Type number-channel                : write3_resource     "Write 3 resource"    [ resourceId=3333333, direction="WriteOnly", commandToReact="3", pulseWidth=300 ]

Number multi_resource_test  "Multi resource test"  { channel="ihc:controller:elko:readonly_resource", channel="ihc:controller:elko:write1_resource", channel="ihc:controller:elko:write2_resource", channel="ihc:controller:elko:write3_resource" }

Men det er vel i realiteten også sådan du har gjort det, bortset fra at du læser fra mqtt..  

Det er lige præcis det.

Med ver. 1.0 brugte jeg følgende linje i items:

Number Temperature_Kontor "Temperatur Kontor [%.1f °C]" <temperature> [ "CurrentTemperature" ] { mqtt="<[mqtt:temp/kontor:state:default]", ihc=">0x410f14" }

Det har virket upåklagelig.

Jeg prøver Pauli ;)

Link til kommentar
Del på andre sites

  • 0

@Pauli Anttila

Hi Pauli,

Any hints or suggestions to why my items do not update the IHC value when a new mqtt message arrives ?

 

In version 1.0 I used:

Number Temperature_Kontor "Temperatur Kontor [%.1f °C]" <temperature> [ "CurrentTemperature" ] { mqtt="<[mqtt:temp/kontor:state:default]", ihc=">0x410f14" }

 

Here in 2.0 I use:

Number Temperature_Kontor "Temperatur Kontor [%.1f °C]" <temperature> [ "CurrentTemperature" ] { channel="mqtt:topic:b5bd6b00:kontor", channel="ihc:controller:elko:temp_kontor" }

 

When I manually click 'ok' under PaperUI->controls it updates fine with the received mqtt value into IHC

 

Link til kommentar
Del på andre sites

  • 0
3 timer siden, LarsC skrev:

@Pauli Anttila

Hi Pauli,

Any hints or suggestions to why my items do not update the IHC value when a new mqtt message arrives ?

 

In version 1.0 I used:

Number Temperature_Kontor "Temperatur Kontor [%.1f °C]" <temperature> [ "CurrentTemperature" ] { mqtt="<[mqtt:temp/kontor:state:default]", ihc=">0x410f14" }

 

Here in 2.0 I use:

Number Temperature_Kontor "Temperatur Kontor [%.1f °C]" <temperature> [ "CurrentTemperature" ] { channel="mqtt:topic:b5bd6b00:kontor", channel="ihc:controller:elko:temp_kontor" }

 

When I manually click 'ok' under PaperUI->controls it updates fine with the received mqtt value into IHC

 

I actually think I got the solutions now !

I had to use the profile option on my item.

 

Number Temperature_Kontor "Temperatur Kontor [%.1f °C]" <temperature> [ "CurrentTemperature" ] { channel="mqtt:topic:node-red:mqtt_temp_kontor", channel="ihc:controller:elko:ihc_temp_kontor" [profile="follow"] }

 

Only minor issue is that I have to restart OH every time i change anything in my items before it will, even though it updates after every save.

Link til kommentar
Del på andre sites

  • 0

@LarsC, openHAB 2 bindings only handles commands, so item updates are not processed by the bindings:

1. Bindings updates channels which are linked to the items

2. Bindings process commands which are send to items which are linked binding channels.

Because MQTT binding updates item state, state isn't send to IHC controller. From Paper UI, you send commands as you want to change the state, therefore command is send to the IHC controller.

Follow profile or rules can be used to handle this situation.

Link til kommentar
Del på andre sites

  • 0
1 time siden, Pauli Anttila skrev:

@LarsC, openHAB 2 bindings only handles commands, so item updates are not processed by the bindings:

1. Bindings updates channels which are linked to the items

2. Bindings process commands which are send to items which are linked binding channels.

Because MQTT binding updates item state, state isn't send to IHC controller. From Paper UI, you send commands as you want to change the state, therefore command is send to the IHC controller.

Follow profile or rules can be used to handle this situation.

Thanks @Pauli Anttila

Got it working with profiles.

 

Link til kommentar
Del på andre sites

  • 0
3 timer siden, LarsC skrev:

Number Temperature_Kontor "Temperatur Kontor [%.1f °C]" <temperature> [ "CurrentTemperature" ] { channel="mqtt:topic:node-red:mqtt_temp_kontor", channel="ihc:controller:elko:ihc_temp_kontor" [profile="follow"] }

I´m curious.. How the heck did you came up with this solution?  No matter how many times I´ve read the doc, I dont see this as an option. 
Am I looking at the wrong docs?? (this link: https://github.com/paulianttila/openhab2-addons/blob/ihc-binding2/addons/binding/org.openhab.binding.ihc/README.md )

Link til kommentar
Del på andre sites

  • 0
3 timer siden, Pauli Anttila skrev:

@Kandersen, profiles are generic features, so they are not IHC binding specific. IHC binding also provides binding specific profiles which can be used only whit IHC binding channels (those are descriped in IHC binding documentation).

Generic profiles are described here

 

 

Ahh ofcouse.. I have never worked with profiles, I use rules insted.  So I didn´t pay enough attention on this part of the openhab doc. 

Link til kommentar
Del på andre sites

  • 0
1 time siden, Kandersen skrev:

Ahh ofcouse.. I have never worked with profiles, I use rules insted.  So I didn´t pay enough attention on this part of the openhab doc. 

I looked at rules aswell, but for my purpose it feels like overkill when I do not want any ekstra functionallty besides updating values.

 

Btw. everything works as expected now, even my OpenWeatherMap to IHC communication - and of course back to Homekit for iphone control of everything.

Link til kommentar
Del på andre sites

  • 0

@Pauli Anttila or anyone else...
Perhaps you can help me with a simular problem.
I´m trying to controle a Philips Hue bulb from an IHC push button. But I can get the Hue Bulb to react at all..

This is my IHC test trigger channel:
Type push-button-trigger           : my_test_trigger "My Test Trigger"                                   [ resourceId=1586524 ]


This is my IHC pushbutton item:
Dimmer    Kontor_Dimmer        { channel="hue:0210:00178821639e:2:color", channel="ihc:controller:elko:my_test_trigger" [profile="ihc:pushbutton-to-command", short-press-command="TOGGLE", long-press-command="INCREASE", long-press-time=1000, repeat-time=200] }


This is what happens when I press the button (either short og long press) and nothing else. 

2019-01-10 23:01:28.391 [vent.ChannelTriggeredEvent] - ihc:controller:elko:my_test_trigger triggered SHORT_PRESS
2019-01-10 23:01:30.379 [vent.ChannelTriggeredEvent] - ihc:controller:elko:my_test_trigger triggered SHORT_PRESS
2019-01-10 23:01:34.258 [vent.ChannelTriggeredEvent] - ihc:controller:elko:my_test_trigger triggered LONG_PRESS
2019-01-10 23:01:35.623 [vent.ChannelTriggeredEvent] - ihc:controller:elko:my_test_trigger triggered SHORT_PRESS

There is no reaction to the Kontor_Dimmer and therefore no reaction to the Hue bulb channel="hue:0210:00178821639e:2:color" either.. 
I can controle the item Kontor_Dimmer just fine from a Slider in sitemap. 

Whats missing?
 

Link til kommentar
Del på andre sites

  • 0
7 minutter siden, Pauli Anttila skrev:

@Kandersen, which ihc binding version you are using (date). I introduced “pushbutton-to-command” profile 14. December, so you need to have version where timestamp is later.

Ahh may be the reason. I think the version I´m using is from 8th. December. I´ll grab the latest and give it another try. 

Link til kommentar
Del på andre sites

  • 0
På 11/1/2019 at 16:28 , Pauli Anttila skrev:

@Kandersen, which ihc binding version you are using (date). I introduced “pushbutton-to-command” profile 14. December, so you need to have version where timestamp is later.

@Pauli Anttila

I just installed the latest binding. It works perfect. I can toggle ON/OFF the Hue bulb. And I can INCREASE the Dimmer. 
But is it possible to DECREASE the Dimmer as well, from the same switch?
I fail to see how this is possible using profiles. 

Link til kommentar
Del på andre sites

  • 0
Quote

Hmm, the IHC controller can do it, (through an function blok though). I would assume openhab/binding could as well.  

Of course you can do it by rules easily in openHAB, but I referred to profiles, which idea is to reduce the simple rule writing. That IHC binding specific profile is already pretty complex, but if all use cases are introduced, it would be really difficult to configure. 

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