QwikSwitch QSUSB
The qwikswitch
integration is the main integration to integrate various QwikSwitch
There is currently support for the following device types within Home Assistant:
The qwikswitch
integration discovers all devices from QS Mobile. Currently, Relays and LED dimmers are discovered in Home Assistant. Relay devices are lights by default, and can be configured as switches.
Configuration
To use the QwickSwitch integration in your installation, add it to your configuration.yaml
configuration.yaml 文件是 Home Assistant 的主要配置文件。它列出了要加载的集成及其特定配置。在某些情况下,需要直接在 configuration.yaml 文件中手动编辑配置。大多数集成可以在 UI 中配置。 [Learn more] file.
在更改了configuration.yaml
configuration.yaml 文件是 Home Assistant 的主要配置文件。它列出了要加载的集成及其特定配置。在某些情况下,需要直接在 configuration.yaml 文件中手动编辑配置。大多数集成可以在 UI 中配置。 [Learn more] 文件后,重启 Home Assistant 以应用更改。 该集成现在显示在集成页面的 设置 > 设备与服务 下。其实体在集成卡片上以及实体标签上列出。
# Example configuration.yaml entry
qwikswitch:
url: http://127.0.0.1:2020
Configuration Variables
A decimal value to adjust the brightness of the dimmer exponentially. Increasing this value allows dimmers that reach full brightness with low values in QS Mobile to appear more linear in Home Assistant. Recommended values between 1 and 2 and the default is 1.
A comma-separated list of button types that will generate events. See [QwikSwitch Events] for detail.
A list of device QS_id’s that should be switches, and not lights (i.e., ['@0dev01', '@0dev02']
)
A dictionary of sensors.
The Qwikswitch sensor type. These could include:
- imod (binary_sensor, up to 6 channels)
- door (binary_sensor, single channel)
- qwikcord (Channel 1 = CTavg, Channel 2 = CTsum)
Invert the open/close state. Only applicable to binary_sensors
The class or binary_sensor. Only applicable to binary_sensors.
QwikSwitch Events
QwikSwitch devices (i.e., transmitter buttons) will fire events on the Home Assistant bus. These events can then be used as triggers for any automation
action, as follows:
automation:
- alias: "Action - Respond to A button press"
triggers:
- trigger: event
event_type: qwikswitch.button.@12df34
event_type
names should be in the format qwikswitch.button.@QS_id. where @QS_id will be captured in the Home Assistant log when pressing the button. Alternatively, you can also get the device ID from the QS Mobile application or by using the listen API call by browsing to http://127.0.0.1:2020/&listen
and then pressing the button.
The full packet from the QSUSB API will be passed as data
By default events will be fired if the value in the command (cmd) field of the listen packet equals:
-
TOGGLE
- Normal QwikSwitch Transmitter button -
SCENE EXE
- QwikSwitch Scene Transmitter buttons -
LEVEL
- QwikSwitch OFF Transmitter buttons
The list of recognized commands can be extended for Keyfobs, door sensors, and PIR transmitters with the button_events configuration option. button_events can be a list or comma separated list of additional commands that will fire Home Assistant events. By default, it is: TOGGLE,SCENE EXE,LEVEL.
On some QS Mobile servers button events are only generated for switches added to the QS Mobile application, so it might be best to test button presses through the /&listen
API
Qwikswitch sensors
The sensor configuration is a list of sensors. Depending on the type of sensor, it will be a sensor or binary_sensor.
Example sensor configuration:
qwikswitch:
...
sensors:
- name: door sensor
id: "@id03"
type: door
- name: Imod 1 sensor
id: "@id02"
channel: 1
type: imod
- name: Imod 2 sensor
id: "@id02"
channel: 2
type: imod
Switch
The qwikswitch
platform allows you to control your QwikSwitch
If the device name in the QS Mobile application ends with Switch
it will be created as a switch, otherwise as a light.