My rule "when a trigger channel fires" does not trigger

Hi,

i wan to trigger a rule, when a channel of zigbee channel changes. Because of a bug, i have to do this manually.

I tried this with the volume channel of a sonos speaker:

configuration: {}
triggers:
  - id: "1"
    configuration:
      thingUID: sonos:One:RINCON_38420BC2A27201400
      channelUID: sonos:One:RINCON_38420BC2A27201400:volume
    type: core.ChannelEventTrigger
conditions: []
actions:
  - inputs: {}
    id: "2"
    configuration:
      blockSource: <xml xmlns="https://developers.google.com/blockly/xml"><block
        type="oh_log" id="[D=WJGDMPcR);FSpDVI)" x="51" y="102"><field
        name="severity">info</field><value name="message"><shadow type="text"
        id="(I1?,zsv27O%YgDAA`Y_"><field name="TEXT">Lautstärke-Channel
        getriggert.</field></shadow></value></block></xml>
      type: application/javascript
      script: |
        console.info('Lautstärke-Channel getriggert.');
    type: script.ScriptAction

My expectation is, that this rule gets triggered, when i change the volume of this speaker. But the rule isn’t triggerd. What is wrong here?

Best regards
Daniel

Can’t you link the channel to an item?
is this a trigger channel?
Greets

I tried this one:
image

I want to get the “events” of the Somrig shortcut button (IKEA):

My idea is, directly triggering the channel…

I don’t know about zigbee binding… I use zigbee2mqtt.
I can’t help here, sorry… Maybe not fully compatible…
Greets

This is another topic.

Here i want to know, how to implement a rule triggerd directly from a thing channel. (doesn’t matter which binding)

The Channel has to be an event Channel, not a State Channel. Not all Channels can be used to trigger a rule. Based on a scan of the Sonos binding docs, this binding doesn’t have any event Channels. The volume Channel must be linked to a Dimnmer Item and then you can trigger the rule based on updates, changes, or commands sent to that Item.

Event Channels are always ephemeral (e.g. button was pressed, civic dawn just started, etc). Something like volume is stateful.

Ah, ok. Thanks for clarification! I didn’t know that.

Actually i want to get a trigger of my somrig ikea “shortcut button”. I didn’t get this working so far and my idea was to write a rule that triggers directly the channel.

Can i see the type of the channel someare in the ui or somewhere else?

This is the code of the channel:

  - id: 5CC7C1FFFE3EBEE4_1_dimmer
    channelTypeUID: zigbee:switch_level
    label: "REMOTE_CONTROL: Level Control"
    configuration:
      zigbee_reporting_polling: 2147483647

I got this idea from a youtube video and the integration of this shortcut button in home assistent. I’m not familar with home assistent. There this device has no states (like on/off of a switch), but you can trigger events.


The name and description of the Channels are controlled by the binding. But usually the Channel will have “event” in the name somwhere.

When looking at the docs for the binding, if the Channel is shown to link to an Item, it’s a state Channel. If it’s an event Channel it will usually be called out in the docs for the binding.

My experience with the Zigbee binding is even momentary buttons like this get modeled with a state Channel, not an event Channel. I’ve a Sparkle zigbee remote button that is modeled this way. Again, it’s all decided by the binding author.

What HA does in this reguard is irrelevant to how OH models the interaction.

Try again by deleting this line

Ok, the solution for this question here is: the Channel has to be an event Channel, not a State Channel. Thanks @rlkoshak

When choosing the thing astro:sun:local, then the ui is working fine, too:
events-sun

Overall event Channels seems to be quite rare. For example the channel motionAlarm (ipCameraBinding) is a switch, too.

Thats is absolutely true and I’m also aware of it. Sometimes it’s interesting to see how others do it. :wink:

This does not work.

Thanks for all your help. I will close this thread and go back to my somrig problem.