Switch radio channels on Streaming Player from KNX push buttons
Example: Switch radio channels on Streaming Player from KNX push buttons, through Logic Machine 2
Task
Assume there are two KNX push-buttons 1/1/1 and 1/1/2. And there are 4 radio channels mapped on Streaming Player to group addresses 9/2/3, 9/2/4, 9/2/5, 9/2/6. We want to make so that when pushing on 1/1/1 the system jumps to the next radio channel, when pushing on 1/1/2 – to the previous one.
Streaming Player radio channel mapping
Event-based script for 1/1/1
- value = event.getvalue()
- up_status = storage.get('upstatus2')
-
- if up_status == nil then
- storage.set('upstatus2', '9/2/3')
- end
-
- if up_status == '9/2/3' then
- storage.set('upstatus2', '9/2/4')
- grp.write('9/2/4', true)
- elseif up_status == '9/2/4' then
- storage.set('upstatus2', '9/2/5')
- grp.write('9/2/5', true)
- elseif up_status == '9/2/5' then
- storage.set('upstatus2', '9/2/6')
- grp.write('9/2/6', true)
- elseif up_status == '9/2/6' then
- storage.set('upstatus2', '9/2/3')
- grp.write('9/2/3', true)
- end
Event-based script for 1/1/2
- value = event.getvalue()
- up_status = storage.get('upstatus2')
-
- if up_status == nil then
- storage.set('upstatus2', '9/2/3')
- end
-
- if up_status == '9/2/3' then
- storage.set('upstatus2', '9/2/6')
- grp.write('9/2/6', true)
- elseif up_status == '9/2/6' then
- storage.set('upstatus2', '9/2/5')
- grp.write('9/2/5', true)
- elseif up_status == '9/2/5' then
- storage.set('upstatus2', '9/2/4')
- grp.write('9/2/4', true)
- elseif up_status == '9/2/4' then
- storage.set('upstatus2', '9/2/3')
- grp.write('9/2/3', true)
- elseif up_status == '9/2/3' then
- storage.set('upstatus2', '9/2/6')
- grp.write('9/2/6', true)
- end