Max2Play Home › Forums › Max2Play Projects and Builds › Battery powered wall switch to start/pause playback?
- This topic has 2 replies, 2 voices, and was last updated 4 years, 10 months ago by alex005 premium.
-
Posted in: Max2Play Projects and Builds
-
19. Dezember 2019 at 15:08 #47817
Hi guys,
I want to have a Wall Switch (Like a light switch) to start Playback. This should be somehow possible with home automation and sending a http request.Has anyone tried that already? Running a full fledged Home automation system is overengineered for this requirement.
I figured there should be Wall Switches that could just send a http request but so far I couldn’t find one.
9. Januar 2020 at 13:04 #47902Hi alex,
You can use our API-Examples Plugin to copy and paste such http requests directly from our web interface to the end device of your choice.
19. Januar 2020 at 15:13 #47942In case someone has the same requirement:
In the end I set up the bigger thing. What I don’t like about it is that have an additional device now that also needs around a Watt of power.
I use a 433MHz radio Wall Button (for example: https://www.aliexpress.com/item/32877220475.html – I had one already for a lamp) and a Sonoff RF Bridge (https://sonoff.tech/product/accessories/433-rf-bridge) Re-Flashed with the Open Source Tasmota Firmware (https://github.com/arendst/Tasmota/).
With this setup I trigger a script in ioBroker which uses the Sonoff (https://github.com/ioBroker/ioBroker.sonoff) and Squeezebox (https://github.com/UncleSamSwiss/ioBroker.squeezebox) ioBroker Adapters .
Problems I ran into setting this up as a total Noob with ioBroker and the RF Bridge:
– Buttons in the Bridge have to learn the Codes the Button sends before RfReceived pops up in ioBroker (Run RfKey<#> 2 in Tasmota console).
– The state of the squeezebox Player has to be set via „Control“ and not the „Update“ command in the ScriptMy ioBroker Blocky script:
(Start Playback when On-Button is pressed between 06:00 and 10:00, Pause Playback when Off-Button is pressed)
on({id: ’sonoff.0.rf_bridge_wohnzimmer.RfReceived_Data‘, change: „ne“}, function (obj) {
var value = obj.state.val;
var oldValue = obj.oldState.val;
if (getState(„sonoff.0.rf_bridge_wohnzimmer.RfReceived_Data“).val == ‚554415‘) {
if (compareTime(„06:00“, „null“, „>=“) && compareTime(„10:00“, „null“, „<=“)) {
setState(„squeezebox.0.wohnzimmerlinks.state“/*wohnzimmerlinks.state*/, 1);
}
} else {
setState(„squeezebox.0.wohnzimmerlinks.state“/*wohnzimmerlinks.state*/, 0);
}
}); -
You must be logged in to reply to this topic.