I am trying to use Openhab and MQTT to turn on and off an Switch using an ESP8266 device flashed with Tasmota (to be more helpfull for others with the same device and problem it is an smart device from the Action named LSC).
Super basic, just to understand how everything works and it works but… now i want to go a step further and connect the Switch to Google Home so I can control the device with my voice. But now i get stuck because the switch doesn’t show up in Google Home app.
I’ve successfully added the test switch and said “hey google, sync my devices” and this device show up.
Switch TestSwitch "Test Switch" [ "Switchable" ]
So it seems like everything is connected correctly.
In the myopenhab i can also control my device via the sitemap, but unfortunately it doesn’t show up in device list, but i found out this wasn’t necessarily, unless you use IFTT, which i don’t.
In the map .\conf\items i have created the file mqtt.items
Switch sVentilator "Ventilator" {channel="mqtt:topic:swVentilator:power"}
In the map .\conf\things i have created the file mqttdevices.things
Thing mqtt:topic:swVentilator "Ventilator" (mqtt:broker:MosquittoMqttBroker) {
Channels:
Type switch : power "Power Switch" [
commandTopic="cmnd/swVentilator/POWER",
stateTopic="stat/swVentilator/POWER",
on="ON",
off="OFF"
]
}
For the sitemap i’ve used the following code and this switch is working correctly.
sitemap default label="Home" {
Frame label="Slaapkamer" {
Switch item=sVentilator label="Ventilator On/Off"
}
}
Can anyone help me out? Where does it go wrong? What did i missed?