I am running openHAB 3.3.0 on RaspberryPI, One of the bindings is LCN.
LCN Modules have tables with a lot of keys, each one can perform 3 different kinds of actions…
What I would prefer is to trigger the LCN-keys with a widget, but without a rule. And that is my questions:
If I would use rules I can do it like this (described in the LCN-Binding documentation)
LCN hit-key
rule "Hit key C4 hourly"
when
Time cron "0 0 * * * ?"
then
val actions = getActions("lcn","lcn:module:b827ebfea4bb:S000M010")
actions.hitKey("C", 4, "HIT")
end
Possible tables are A-C, possible keys are 1-8 and possible actions are HIT, MAKE and BREAK.
I have no idea how to implement the “getActions” and the “actions.hitKey” -part into a oh-button or any other widget-component.
For any hint to that I thank you in advance.
Paul
In the meantime I developed a widget which - for testing purpose only - is working correctly within the lightgreen part to switch the LED3 on and off.
But the blue part to switch LED4 on and off via the hitkey-command does not anything. Probably I made some mistakes…
uid: oh-button-lcn-action
tags: []
props:
parameters: []
parameterGroups: []
timestamp: Jul 22, 2022, 5:50:32 PM
component: f7-card
config:
title: oh-button-lcn-action (Test hitkey on M025)
slots:
default:
- component: f7-block
config:
class: bog
style:
display: flex
justify-content: left
padding: 20px
slots:
default:
- component: oh-button
config:
text: LCN LED 03 ON
outline: true
style:
margin-right: 10px
width: 200px
action: command
actionCommand: ON
actionItem: Module25UGBuero_LED3
- component: oh-button
config:
text: LCN LED 03 OFF
outline: true
style:
margin-right: 10px
width: 200px
action: command
actionCommand: OFF
actionItem: Module25UGBuero_LED3
- component: f7-block
config:
class: bog
style:
display: flex
justify-content: left
padding: 20px
slots:
default:
- component: oh-button
config:
text: LCN hitkey B1 LED4 OFF
outline: true
style:
margin-right: 10px
width: 200px
action: command
actionCommand: getActions("lcn","lcn:module:0a88228d93:S000M025").hitKey("B", 1, "HIT")
- component: oh-button
config:
text: LCN hitkey B2 LED4 ON
outline: true
style:
margin-right: 10px
width: 200px
action: command
actionCommand: getActions("lcn","lcn:module:0a88228d93:S000M025").hitKey("B", 2, "HIT")
Where is my mistake ?