Writing a toggle rule

Ok, i will have a look at that.
I am using txt files for Things, Channels and items. So i have to create a trigger channel and see how it reflects in the UI to a txt created channel.

A good example of the benefits of managing things and items through MainUI. I made the transition and I never regret it. Just to encourage you…

Ok, configured an event channel and got the loginfo written.

when
    Channel "mqtt:topic:MyMQTTBroker:IkeaSwitchrund1:EventChannel" triggered brightness_up_click
then
logInfo('MIRHOME', 'Rule triggered ' + receivedEvent)
end

With nothing behind “…” triggered it does not work.
I would like to do the identifying what message was triggered in an IF Statement like this:

    var actionName = receivedEvent
    if(actionName == "toggle") {
       gLights.sendCommand(OFF)
    }
    if(actionName == "brightness_down_click") {
       gLightsdimmer.sendCommand(50)  
    }

Is this possible?

yes, it is possible.
If you use

Channel "mqtt:topic:MyMQTTBroker:IkeaSwitchrund1:EventChannel" triggered

What does loginfo say?

Ok, it triggered and had the text… Easy as hell :slight_smile:
Well i wont spend time why it didnt do right after i created the Event Channel. maybe i didnt save the rule.

Now ill try to go up in steps if “brightness_up_click” is triggered. That means you will hear from me again :slight_smile:

Thnx a lot for your time, all of you.

Cheers
Michael