So I’ve set up the Google Assistant Integration successfully and also added a “TRADFRI ON/OFF switch (E1743) by IKEA” using MQTT and Zigbee2mqtt - as displayed in Device Info within HA.
The problem is that despite it clearly saying Switch in the Device info - it’s showing up as a Sensor and so isn’t accessible or visible within the otherwise working Google Home integration.
I’ve seen the https://www.home-assistant.io/integrations/switch.template documentation and a post elsewhere about wrapping a light as a switch using light.template and I’m trying to apply that to make the E1743 “sensor” operate or be available as a switch but I’m struggling to interpret the example code in the documentation which doesn’t seem consistent or complete. Here’s what I’ve got so far but couldn’t figure out how to map the entity_id - here “skylight” to anything in my setup:
Is it even possible to make a Sensor operate as a switch or is there a bug in zigbee2mqtt that should view the IKEA E1743 as a switch but instead incorrectly reports as a “sensor”? Any ideas?
Sorry for extended delay replying. Thanks for explaining about the E1743. I’ve not had any luck getting this to work.
I basically use Node Red within Home Assistant to do a all of my automations and I’m trying to find a way to use the Google Assistant to change the state of the IKEA E1743 (turn on and off).
But since it’s a sensor as you say, I’m not sure how to create a virtual switch in Home Assistant that I can then talk to using Google Assistant (which I’ve already set up and can see my other switches) to turn on and off. From what I can tell, the sensor can turn a virtual switch on and off, but what I want is to be able to send the message the other way and turn the switch on and off by voice.
I had a different issue to you but to get round it I created an input boolean and exposed that to Google Home where it appears as a switch. Two simple Google Home routines turn on or off that switch. When the state of that input boolean changes, node red either turns the TV socket on or off.
@doug987 Sounds like a great idea. I did have a go at setting up an input boolean and including the “exposed_domains” part in the settings to “input_boolean” alongside “light” and “switch” for my “google_assistant” settings but it didn’t seem to work.
If you wouldn’t mind, please could you let me know how you set up your input boolean and then had it appear as a switch within HA? Also, how you set up the state detection within Node RED would be useful for some pointers on a working example.
I first set this up a couple of years ago and so have just redone it to remind myself. It is simpler than I remember but then technology and I have moved on.
Create an input boolean in HA. Easiest way in with Configuration Helpers
Expose to Google Assistant. For the last 6 months I have been using Nabu Casa but originally I had used the manual integration. Nabu Casa is simple.
Once the entities are sync’ed the input boolean should appear as a switch in the Google Home app
That’s amazing! Thanks so much for taking the time to do screenshots for each step! I’ll give it a go as soon as I can and hopefully get it working
UPDATE: I got it working. I added the Input Boolean and then added that to the list of exposed domains in the Google Assistant section on my configuration.yaml file and it worked Thanks again!