Sorry, that testing page is outdated. That was based on topic configuration, which has been removed.
If you followed the 3 setup steps the device should be visible in your HA devices page.
you should be able to send a command to the following topic. mosquitto_pub -t tuya/<device-id>/<dp-key>/command -m ON
e.g. mosquitto_pub -t tuya/34280100600194d17c96/1/command -m ON
hth
@dmpk there is no add-on thingy available (yet) @denis.besir Purely technical speaking, yes it should be possible. It doesnāt take much system resources. But I donāt work with hassio, and donāt know anything about the limitations it imposes
I have noticed though that the names in HA are switch.on_off and switch.on_off_2 that I set up. In Gismocaster they I named the Gismo with a more descriptive name.
I now see the message for command ON when I call the service, but it is not actually affecting the light itself which makes me think I have it set up wrong in Gismocaster.
Ok here we go. New behaviour is that I can turn on the switch via HA / Gismocaster but every time I send a command to the switch it flips to offline then back online. The on command worked, but the off command wonāt stick (or at least HA doesnāt get the state change that is published).
Hereās what Iām seeing from a simple switched outlet:
Message 20 received on tuya/02200360600194733ae3/availability at 10:58 AM:
offline
QoS: 0 - Retain: false
Message 19 received on tuya/02200360600194733ae3/availability at 10:58 AM:
online
QoS: 0 - Retain: false
Message 18 received on tuya/02200360600194733ae3/availability at 10:58 AM:
offline
QoS: 0 - Retain: false
Message 17 received on tuya/02200360600194733ae3/availability at 10:58 AM:
online
QoS: 0 - Retain: false
Message 16 received on tuya/02200360600194733ae3/availability at 10:58 AM:
offline
QoS: 0 - Retain: false
Message 15 received on tuya/02200360600194733ae3/availability at 10:58 AM:
online
QoS: 0 - Retain: false
Message 14 received on tuya/02200360600194733ae3/availability at 10:58 AM:
offline
QoS: 0 - Retain: false
Message 13 received on tuya/02200360600194733ae3/availability at 10:58 AM:
online
QoS: 0 - Retain: false
Message 12 received on tuya/02200360600194733ae3/availability at 10:58 AM:
offline
QoS: 0 - Retain: false
Message 11 received on tuya/02200360600194733ae3/availability at 10:58 AM:
online
QoS: 0 - Retain: false
Message 10 received on tuya/02200360600194733ae3/availability at 10:58 AM:
offline
QoS: 0 - Retain: false
Message 9 received on tuya/02200360600194733ae3/availability at 10:57 AM:
online
QoS: 0 - Retain: false
Message 8 received on tuya/02200360600194733ae3/availability at 10:57 AM:
offline
QoS: 0 - Retain: false
Message 7 received on tuya/02200360600194733ae3/availability at 10:57 AM:
online
QoS: 0 - Retain: false
Message 6 received on tuya/02200360600194733ae3/availability at 10:57 AM:
offline
QoS: 0 - Retain: false
Message 5 received on tuya/02200360600194733ae3/1/command at 10:57 AM:
OFF
QoS: 0 - Retain: false
Message 4 received on tuya/02200360600194733ae3/availability at 10:57 AM:
online
QoS: 0 - Retain: false
Message 3 received on tuya/02200360600194733ae3/availability at 10:57 AM:
offline
QoS: 0 - Retain: false
Message 2 received on tuya/02200360600194733ae3/availability at 10:57 AM:
online
QoS: 0 - Retain: false
Message 1 received on tuya/02200360600194733ae3/availability at 10:57 AM:
offline
QoS: 0 - Retain: false
Message 0 received on tuya/02200360600194733ae3/availability at 10:57 AM:
online
QoS: 0 - Retain: true
The good news is for a single wall switch I am getting the following:
Message 4 received on tuya/05200385dc4f222a77db/1/state at 10:59 AM:
OFF
QoS: 0 - Retain: false
Message 3 received on tuya/05200385dc4f222a77db/1/command at 10:59 AM:
OFF
QoS: 0 - Retain: false
Message 2 received on tuya/05200385dc4f222a77db/1/state at 10:59 AM:
ON
QoS: 0 - Retain: false
Message 1 received on tuya/05200385dc4f222a77db/1/command at 10:59 AM:
ON
QoS: 0 - Retain: false
Message 0 received on tuya/05200385dc4f222a77db/availability at 10:59 AM:
online
QoS: 0 - Retain: true
How do I reference individual switches on a multi-gang switch or a power bar with 4 independently switched outlets? I assume I need to build a different gismo model for those?
The gismo model describes the device. So, 1 model for e.g. all 2 gang switches (assuming they are of the same brand/type). For each specific device e.g. 2 gang switch in hallway and 2 gang switch in living you create a gismo and reuse (link) the gismo model.
Defining a model with multiple dp points (e.g. 2 or 3 gang switches) You add a extra dp key and select the ha component. ha topic (state_topic for switches)
For the 2 and 3 gang switches I have the extra dp keys are 2 and 3. (good chance that is the same for your devices but not guaranteed. )
Iām working to get this solution setup and Iāve found that when I restart MQTT my switches and lights become unavailable. It looks like once MQTT restarts and Tuyagateway loses its connection the only solution is to restart the tuyagateway service on my linux box. Once I restart the tuyagateway service everything works perfectly. I was thinking I could use the HA command line switch to restart the tuyagateway service when HASS restarts and also create a button to do a restart on demand if I manually restart MQTT. I was wondering if anybody else has any better suggestions.
P.S. This solution is very promising and exciting! Thanks to the developer. I have my switches and an LED light setup. Iām working on a Gizmo template with a dimmer switch and then all 30 or so of my Tuya devices will be local without flashing.
Hi Brian,
Perhaps your MQTT Broker isnāt setup correctly. TuyaGateway sends HA discovery messages to MQTT with the retain flag. So it wonāt send it again to prevent unnecessary network connections. The MQTT broker is expected to retain the messages as well (also on reboot). If youāre using mosquitto youāll have to configure the database (path).
hth