junior466
(Junior466)
November 13, 2017, 2:37am
1
I am trying to get a switch to activate a script that will send a command to turn on my fan.
Here’s what I have:
- platform: template
switches:
fan:
value_template: "{{ is_state('script.fan_on', 'on')}}"
turn_on:
service: script.turn_on
entity_id: script.fan_on
turn_off:
service: script.turn_on
entity_id: script.fan_off
Script
fan_on:
sequence:
- service: remote.send_command
entity_id: remote.living_room
data:
device: "42546817"
command: "PowerToggle"
fan_off:
sequence:
- service: remote.send_command
entity_id: remote.living_room
data:
device: "42546817"
command: "PowerToggle"
The above does not work. I copied the above from this post .
Any help would be greatly appreciated!
Jer78
(Jeremy Percival)
November 13, 2017, 4:13am
2
It should work. I’d delete the Harmony config file, restart HA and check it again to make sure the device number in case it changed.
1 Like
junior466
(Junior466)
November 13, 2017, 2:58pm
3
That did the trick! Thanks!
Jer78
(Jeremy Percival)
November 14, 2017, 2:32am
5
@junior466 In case you’re interested, here’s a better way of using a fan to control the speed and know the on/off state. It’s not bullet proof but works better imo
Finally was able to add the desired timer
Mainly using the idea of tboyce1 Stopwatch. Slightly modifiying it, and using a 3rd Sensor to display the remaining time in minutes.
[Capture]
The addtiional code:
configuration.yaml
input_boolean:
stopwatch:
name: Stopwatch
initial: off
dummy:
name: Dummy
initial: off
groups.yaml
card_dysonlr:
name: Dyson Wohnzimmer
entities:
- input_boolean.livingroomfanoscillate
- input_boolean.livingroomfanpower…
junior466
(Junior466)
November 14, 2017, 2:28pm
6
@Jer78 That’s great but the thing is I need a switch because I am using it through HADashboard, not the Home Assistant frontend.
Can you help me at this post? Switch that holds its own state