2018-10-29 00:22:23 +01:00

49 lines
2.1 KiB
Markdown

+++
title = "Broadlink"
date = "2018-08-06T13:43:48.000Z"
+++
The broadlink app will output all found devices on start, you can use this to setup your config file as shown bellow
Config Setup example
```
class Config(ConfigObject):
def setup(self):
# Broadlink devices --------------------------------------------------------
self.broadlink_livingroom = EventObject("broadlink", "064cdf434ead4")`
# WebApp -------------------------------------------------------------------
self.webapp_livingroom_tv_on = EventObject("webapp", "livingroom.tv.on", "true")
def process_event(self):
if self.webapp_livingroom_tv_on.event == "true":
self.broadlink_livingroom.set("26008403120a110b0e0f0d0f0d100d2c110b0d100d0f0d0f0d100d0f0e0f0d0f0d0f0e2b1309"
"0e0f0d100d0f0e0e0e0f0d0f110c0d2b0e0f0d2c0f290e2b0e2b120a120b11280d0f0d2c0e2b"
"0e2b0e2a0e0f11280e00097876350f0d0e2b120a0d100d0f0d100d0f120a0d100d0f0d100e0"
"e0e0f0d2b0e0f110b0d100d0f120a120b0d0f0d100e0e0d2c0e0e0e0f0d0f0d100e0e0e0e13"
"090e0f0d2c0e0f0d2b132613260f2a0e0e120a0f2a0e0f0d2c112713260e2b120a0e2b130009")
```
To lear a ir code send "learning" event to a broadlink device, aim you remote towards the broadlink device and
push the button you which to learn.
You will then get an event back from the broadlink app with the code, cut and past that into your config file
as showed above
Learning event example
```
class Config(ConfigObject):
def setup(self):
# Broadlink devices --------------------------------------------------------
self.broadlink_livingroom = EventObject("broadlink", "064cdf434ead4")`
# WebApp -------------------------------------------------------------------
self.webapp_livingroom_learn = EventObject("webapp", "livingroom.broadling.learn", "true")
def process_event(self):
if self.webapp_livingroom_learn.event == "true":
self.broadlink_livingroom.set("learning")
```