Trigger channel info in Blockly

Hi,

I would like to write a rule that is triggered by one of multiple trigger channels, and then have different Blockly code depending on which channel was triggered. However I cannot find a way in Blockly to access the information which channel was triggered.

Am I missing something or is this not possible? Since the thing/channel is stateless, it seems I cannot really access it from there, and also there do not seem to be any kind of “local” variables that store such information within the rule context.

Here is how my triggers look like:

triggers:
  - id: "1"
    configuration:
      thingUID: openwebnet:bus_cenplus_scenario_control:22eef285a7:22
      channelUID: openwebnet:bus_cenplus_scenario_control:22eef285a7:22:button#1
    type: core.ChannelEventTrigger
  - id: "3"
    configuration:
      thingUID: openwebnet:bus_cenplus_scenario_control:22eef285a7:22
      channelUID: openwebnet:bus_cenplus_scenario_control:22eef285a7:22:button#2
    type: core.ChannelEventTrigger

The code in Blockly should be something like this:


if ( button 1 was fired ) {
  events.sendCommand('EG_WZ_Couchtisch', 'ON');
}
if ( button 2 was fired ) {
  events.sendCommand('EG_WZ_Couchtisch', 'OFF');
}

Thanks for your help!

contextual info:

grafik

Edit:

1 Like