jansepke
(Jan Sepke)
January 1, 2017, 3:21pm
1
Hi all,
what do you think about a switch that calls a HA service. eg:
switch:
- platform: service
on:
service: remote.send_command
data:
foo: bar
off:
service: remote.send_command
data
foo: bar2
I need something like this to control logitech harmony devices and I think it could be used for much more.
andrey
(Andrey)
January 1, 2017, 5:09pm
2
I thin kyou can already do this with the template switch: https://home-assistant.io/components/switch.template/
jansepke
(Jan Sepke)
January 1, 2017, 5:48pm
3
but what would I put into the value_template property when I don’t have a sensor to listen to?
andrey
(Andrey)
January 1, 2017, 7:21pm
4
Actually you can use https://home-assistant.io/components/input_boolean and set automation to react on state change.
jansepke
(Jan Sepke)
January 1, 2017, 7:40pm
5
that’s what I actually do, but I don’t think that this is optimal. that’s why I thought of a service switch. I could make a PR for it, if you think that it should be integrated into HA
andrey
(Andrey)
January 1, 2017, 8:29pm
6
I think in that case I think you should expand the input_boolean (and the other input_X) components.
But since I’m not a deciding vote you should probably wait for a maintainer opinion
ayo91
(Ayo)
December 5, 2018, 12:21am
7
Any news? I have the same problem. I would like to have a switch to turn on and turn off the Xiaomi Aqara ringtone service…
1 Like