kalpcc
(Kenneth Lawrence)
1
Hi all.
I it possible to use the Xiaomi switch to controll a sonoff switch?
The xiaomi entity is binary_sensor.switch_158d0001548880
sonoff entity is group.stuen and uses mqtt like this:
switch:
- platform: mqtt
name: “Stue Lampe K”
state_topic: “stat/stuek/POWER”
command_topic: “cmnd/stuek/power”
payload_on: “ON”
payload_off: “OFF”
optimistic: false
qos: 0
retain: true
I also want to use the xioami pir sensor to controll lights in my appartment
the xiaomi entity is binary_sensor.motion_sensor_158d000153705a
Regards from Kenneth
kalpcc
(Kenneth Lawrence)
3
I did, but it looks like the xiaomi switch only controlles the xiaomi Hub in the example : )
ursus69
(Jose Garcia)
4
In te Action you can call wathever service you want.
What you see there are only examples!
kalpcc
(Kenneth Lawrence)
5
Thanks. I Will Try to put something together.
kalpcc
(Kenneth Lawrence)
7
Thanks ![:slight_smile: :slight_smile:](https://community.home-assistant.io/images/emoji/twitter/slight_smile.png?v=9)
I got the second half of the automation to work.
I can turn off switch.kontorseng, but not on.
Any idea’s
This is my configuration:
automation:
- id: 1
- alias: Turn on all livingroomlights
trigger:
platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_158d0001548880
click_type: long_click_press
action:
service: homeassistant.turn_on
entity_id: switch.kontorseng
automation:
- id: 2
- alias: Turn off all livingroomlights
trigger:
platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_158d0001548880
click_type: double_click_press
action:
service: homeassistant.turn_off
entity_id: switch.kontorseng
double_click_press -> double
kalpcc
(Kenneth Lawrence)
9
I got it to work with this configuration:
- alias: Turn on all livingroomlights
trigger:
platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_158d0001548880
click_type: single
action:
service: switch.toggle
entity_id: switch.kontorseng
Thanks a bunch for the help I got ![:slight_smile: :slight_smile:](https://community.home-assistant.io/images/emoji/twitter/slight_smile.png?v=12)
prosty
10
Here’s what I did to get the same working. With whitespace ![:wink: :wink:](https://community.home-assistant.io/images/emoji/twitter/wink.png?v=9)
- id: ‘1528072044906’
alias: New Automation
trigger:
- platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_158d000155d38a
click_type: single
condition: []
action:
- service: switch.toggle
entity_id: switch.sonoff_switch_01