REST interface for the Broadlink S3 hub; home assistant integration via RESTful switch or sensor
2.7K
REST interface for the Broadlink S3 hub
SUPPORTED_TYPES = {
s3: {
0xa64d:("S3", "Broadlink"),
0xA59C:("S3", "Broadlink"),
}
Initialise hub with the first request
http://127.0.0.1:5000/?hub=192.168.1.99
Get the state of a sub device where: @app.route("/<did>",methods = ['GET'])
http://127.0.0.1:5000/00000000000000000000a043b0d0783a
Toggle sub devices /gangs using the dynamic URL. Where: @app.route("/<did>/<gang>",methods = ['POST', 'GET']). (only switches supported)
http://127.0.0.1:5000/00000000000000000000a043b0d0783a/1
Can be used to set up restful switches in home assistant:
switch:
- platform: rest
resource: http://192.168.1.162:8124/00000000000000000000a043b0d0783a/1
body_on: '{"active": "true"}'
body_off: '{"active": "false"}'
is_on_template: "{{ value_json.is_active }}"
Can also be used to set up sensors in Home assistant - the example below shows a wall light switch; door sensors and motion sensors will also work but you would need to change the attributes.
sensor:
- platform: rest
name: Light
resource: http://192.168.1.162:8124/00000000000000000000a043b0d0783a
value_template: '{{ value_json }}'
json_attributes:
- pwr1
- pwr2
https://github.com/stevendodd/python-broadlink/tree/Add_S3_REST_API
https://community.home-assistant.io/t/broadlink-s3-hub-support/319832/18?u=stevendodd
Content type
Image
Digest
Size
53.8 MB
Last updated
over 4 years ago
docker pull stevendodd/s3-rest-api