I have a three-button 433MHz remote that sends the values 1 2 and 3
I have an item mapped that represents this remote.
The item has two channel links.
One link to the 433MHz-channel on MQTT (all remotes just send a certain number) with
a map transformation like this: 1=PREVIOUS, 2=NEXT, 3=PAUSE
The other channel link goes to the trackPlayer channel on the spotify bridge thing.
My goal is to have my three-button-remote send PREVIOUS or NEXT and toggle PLAY/PAUSE state to the spotify player channel.
However this doesn’t seem to work. Only pause works, it doesn’t toggle, previous and next are ignored.
I think it’s more simple minded than you supposed, it does what you tell it to do, i.e. PAUSE is PAUSE
However, I think you’ve fallen in a hole here, and it will never do what you want.
a) A Player types Item state is distinguished from command, these are not the same thing. Example, you can send a command NEXT and the resultant state could be PLAY.
b) It’s not possible to update the Item state to a unsupported state, like NEXT.
c) a follow profile can only (attempt to) mirror an Item state out to an external channel. It won’t even see commands to the Item, so for example here it could never send NEXT.
I think your bet here is a more conventional approach. Link your remote into an Item representing only the remote.
Have a rule listen out for commands from your remote and massage them into commands suitable for your player Item, linked only to spotify.
Because PLAY/PAUSE are valid states for a Player type Item as well as valid commands
Compare with a Dimmer type Item, where only numeric states are valid, yet you can command it ON (probably resulting in state 100%)
Use a follow profile on a Dimmer Item and it will pass through state 50% as though it were a command, but never ON or OFF since these never appear as Dimmer states.
The follow profile is of very limited usefulness for the complex Item types beyond Switch, Number, and String.
Haven’t you already got Item rf433toMQTT_message with your remote activity? Not sure what you want another one for.
Your rule just needs to listen out for message like 9082980 and respond by commanding NEXT to your Player Item, etc.?
I think I’d use the MQTT channel option for postCommand though, so that incoming messages from the remote generate commands instead of state updates, making the remote act more like the openHAB UI.
Makes it easier to handle repeated press of same button.