I created some Input Boolean switches to run different scripts or scenes depending whether switched on or off. They work OK in Home Assistant but for some reason don’t work at all under emulated hue with Alexa.
For example if I told Alexa to ‘turn on the Living Room’ it (should) turn on the Input Boolean switch and run the ‘on’ scene. And if I told Alexa to ‘turn off the Living Room’ it (should) turn off the Input Boolean switch and run the scene for off.
Here’s an example of the code I’m using:
input_boolean:
living_room:
name: "Living Room"
automation:
- alias: "Living Room on selected"
trigger:
- platform: state
entity_id: input_boolean.living_room
to: 'on'
action:
service: scene.turn_on
entity_id: scene.living_room_on
- alias: "Living Room off selected"
trigger:
- platform: state
entity_id: input_boolean.living_room
to: 'off'
action:
service: scene.turn_on
entity_id: scene.living_room_off
Is there any way of doing this without an Input Boolean switch? (Or a way to make input boolean switches work with Alexa?)
I tried just using scenes called ‘Living Room on’ and ‘Living Room off’, but it seems to confuse Alexa and she goes through the ‘I found more than one device with that name…’ thing.
We would have to see how your emulated hue component is set up, but by default input_boolean should work with Alexa. I have to admit that I found the emulated Hue environment too restricted, and have implemented a skill instead. If you go the skill route, there’s virtually no limit to what you can do. It’s not as hard as it looks, but you do have to expose your HA instance to the internet.
Thanks, it looks like it should be possible with that.
Although I’m not sure how I’d adapt it to my simpler switch (just turning on/off scenes or scripts).
I don’t think my understanding of Home Assistant is quite up to that
The alternative is to use automation and input select like here. The automation will run your scene when input select goes on and run a scene when it goes off.
The template switch should work but you need to decide how you want its state to appear. If it doesn’t matter how it appears, then you should replace value template with anything.
I can’t seem to get this working
I tried many things.
Error I get now is:
2017-11-11 17:15:55 ERROR (MainThread) [homeassistant.config] Invalid config for [switch.template]: [Badkamer_Verwarming] is an invalid option for [switch.template]. Check: switch.template->switches->Badkamer_Verwarming. (See ?, line ?). Please check the docs at https://home-assistant.io/components/switch.template/
So capitals letters are not allowed. No errors now but…when I flip the switch it does trigger the scene (badkamer_aan), however the switch flips rigth back to the off state.
So I can’t flip it off manually to run the turn_off scene.
Any idea about that?
My goal is that I have 1 switch to “toggle” the running of 2 separate scenes.
When turned on it runs the scene that turns my heater on and when turned off it should run the scene that turns my heater off.
I thought reading the earlier posted code would do that.
Let’s say your heater is switch.heater.
Let’s say further that switch.heater is turned on with scene.badkamer_aan and switch.heater is turned off with scene.badkamer_uit.
The you could use this template to determine if the switch is on or off:
Ah ok I understand. Problem is, the heater itself is not a switch. I set a temperature and then the zwave device opens/closes the valve more or less.
So the only reading I can do is the temperature.
If above 26 degrees then the (on) scene to put it on that setting was run.
If it’s below 15 the (off) scene ran to put it on that setting.
So you know how I can change that value template to check whether it’s above or below a certain temp?