I am a n00bie moving from ST->HE->HA. I have been learning a lot surrounding NodeRed and automations. I am now incorporating Alexa and have a need for virtual switches that can be triggered by Alexa and then sent to HA. I have tried using a helper input_boolean_toggle but it is not available as a switch/light or anything useful from a voice command. I have attempted to create a switch template, it shows up in HA and Alexa but the two are not communicating correctly.
Some info:
I am using the pay-to-play Cloud Integration for Alexa
My goal is to say “Alexa, turn on Doggy Bed Time” and then my NodeRed routine would execute
Current Switch Template located in the configuration.yaml file:
I don’t see why you are using a template switch for an entity that is already in the switch domain though.
You have just duplicated the switch.doggy_bedtime to switch.doggybedtime. How is this going to help with Alexa when the first entity is already a switch?
That is my point. I do not know what I am doing for switch templates. Do you have an example of a simple switch that would become a virtual switch? Also one that would work in lovelace so I can add it to a card?
Virtual Switch on other platforms is just a “dummy” switch that can be turned on/off. The template switch looks like to be the same thing. I am trying to create a empty switch that is not connected to anything but is also not the input_boolean_toggle as many reference in the forums. It needs to be a switch for Alexa to do anything with it.
if the input_boolean is input_boolean_doggy_bedtime could you help me with what the configuration.yaml code would looke like for the template switch? This is where I am getting confused is between the template switches and helpers. I do appreciate your responses btw.
An input_boolean can be directly exposed to Alexa (at least it can when using NabuCasa, not sure about other methods) so there’s no need for anything other than the input_boolean.
Just have Alexa turn it on and off and trigger from that.
Alexa can’t do anything with it. Look at the type in the screen capture. It says other. Alexa responds back that the skill cannot do anything with this device.
Thank you so much for the help! That works like a charm. Maybe you know the answer to this next question…
Template Switch doesn’t allow me to add the switch to other “areas.” When getting the properties of the entity to associate the switch lovelace responds with a message “This entity does not have a unique ID, therefore its settings cannot be managed from the UI.”
If you want the to expose a Virtual Switch correctly in alexa, the best option is to create a virtual device from Tuya. You have to create a developer account on https://iot.tuya.com/, after that, create a cloud project (it’s free) and from there create a virtual device. Be sure that you have linked your Tuya Account with home assistant.