Hi everyone,
I am building a RESTful bridge device for use with Home Assistant. It will be open source, although I haven’t uploaded my code to github yet. The project primarily uses Python and Flask and runs on a Raspberry Pi. I’m currently using the pi_switch library to relay 315 and 433 MHz RF signals.
Using curl, I am able to successfully send JSON POST requests to the bridge device to turn my appliances on and off. The RF outlets themselves are stateless. There are individual on and off buttons on the original remote control.
The current work-around is to configure two separate switches. One RESTful switch device to send an ON request and another to send an OFF request.
switch:
platform: rest
resource: http://192.168.1.110:80/rf
name: "Floor Lamp ON"
body_on: "{\"code\":\"13376\",\"bits\":\"15\",\"pulse\":\"800\",\"protocol\":\"2\"}"
body_off: "{\"code\":\"13376\",\"bits\":\"15\",\"pulse\":\"800\",\"protocol\":\"2\"}
platform: rest
resource: http://192.168.1.110:80/rf
name: "Floor Lamp OFF"
body_on: "{\"code\":\"13344\",\"bits\":\"15\",\"pulse\":\"800\",\"protocol\":\"2\"}"
body_off: "{\"code\":\"13344\",\"bits\":\"15\",\"pulse\":\"800\",\"protocol\":\"2\"}
Instead of using this work-around, I was hoping there was a configuration to somehow allow two individual on/off buttons. I recall seeing a roller shutter component in the demo a few months ago. It had individual up, down and stop buttons. Is it possible to customize/override a switch component to do this?
If this isn’t possible with the current build, I would be quite interested in adding this functionality somehow. Perhaps by adding support for a “stateless” configuration parameter for switches?