[SOLVED] Using the profile "follow", avoiding loops?

Tags: #<Tag:0x00007f5ca1a66ff8> #<Tag:0x00007f5ca1a66670>

Hi Guys,

would like to use the profilefollow”.

I have e.g. two items:

itemA and itemB.

I would like itemB to follow itemA, but also itemA to follow itemB.

Will this create a loop? Or is that impossible?

The description here says that the FollowProfile ignores state updates.
.

here is the syntax:

<itemType> <itemName> {channel = "<channelUID>", channel = "<followChannelUID>" [profile = "follow"]}

Example:

Switch itemA {channel="xxxx.of.itemA", channel="xxxx.of.itemB" [profile="follow"]}
Switch itemB {channel="xxxx.of.itemB", channel="xxxx.of.itemA" [profile="follow"]}

I could try on my own, but I’m afraid of an overflowing logfile or something else.

You should just try it out. If OH ends up in a look, just kill OH, back out the follow, and start OH again.

I suspect it will work just fine.

1 Like

I did it. It is running. :slight_smile: No loop!

Example:

Switch itemA {channel="xxxx.of.itemA", channel="xxxx.of.itemB" [profile="follow"]} 
Switch itemB {channel="xxxx.of.itemB", channel="xxxx.of.itemA" [profile="follow"]}

Hello everybody,

I have a similar case, but do not get it work…

There is one items that needs to be bind to two channels (zwave and mqtt) like this:

Switch testswitch { channel="zwave:...", channel="mqtt:..." }

This works fine if a command is received by mqtt or zwave. But if I use a switch manualy connected to the zwave device, there is a update received only on zwave channel - no changes in mqtt.

Following the solution I added the “follow”-profile. But if a command receives now, the connected lamp starts blinking…

Switch testswitch { channel="zwave:...", channel="mqtt:..." [profile="follow"] }

Does anyone have a hint? The zwave device is a Fibaro FGS-223.

Thanks Björn

To the wrong channel.
If you want “something changed” at the zwave device to cause a command to this Item - which will in turn get passed to the MQTT command topic - then it’s the zwave channel that needs the profile.
You might also want the “normal” zwave status to update the Item, so you’d probably end up with three channels for this Item.

Depending how your end devices respond to commands, you may still get a loop.

If you do still get a loop after following rossko57’s advice, you will need to do this with a Rule.

Moving [profile=“follow”] from mqtt-channel to zwave channel did not work for me. The switch item does not get updated when I use the physical switch…

I removed the profile and wrote a simple rule:

rule "Send command on change"
when 
    Member of Switches changed
then
    sendCommand(triggeringItem, newState)
end

The testswitch was added to the “Switches” group. Is there a magic to trigger any change? This instance is “only” a bridge.

Then that’s where your problem possibly is. When you switch a zwave light using the physically connected switch, OH does not know so it cannot apply the follow profile until it receives that info from the actuator. Check your associations.

1 Like

You should also bear in mind how it works -

zwave channel with follow profile - if you have an incoming state update from zwave (which is in doubt) the profile intercepts that and turns it into a command to the linked Item instead.
In other words, the state update is not done.

Item state could still be updated by some other binding or autoupdate responding to that command, so that may not be a problem.

You might want to have a non-follow zwave channel as well in order to get ordinary state updates.

But first, let’s find ot if you get any zwave updates.