Issue of the topic: I want to send some Mqqt messages issued by some voice commands from Google Assistant.
I have setup the embedded MQTT broker with the 2.4.0 MQTT binding and when I manually send commands via console, everything is working as intended.
When I toggle the below stated switch, nothing is happening (no mqtt message arrives).The current mqtt documentation is not mentioning outbound messages anymore. Is that still supported and if yes how do I need to do that?
configurations:
Switch test "test" <switch> [ "Switchable" ] {mqtt=">[embedded-mqtt-broker:winthing/keyboard/commands/press_keys:command:ON:testmessage],>[embedded-mqtt-broker:winthing/keyboard/commands/press_keys:command:OFF:testmessage]", autoupdate="false"}
You need to create a MQTT bridge thing in the paperUI
Configuration → Things → + → MQTT Binding (The binding should scan for brokers but if it doesn’t find one select MQTT Broker) - Enter your broker parameters → Save
Then you need to create another thing for your sonoff:
Configuration → Things → = → MQTT Binding → Add manually → Generic MQTT Thing
Open the thing and add a switch channel
For a sonoff Tasmotta you need the the outbound: winthing/keyboard/commands/press_keys
BUT the binding will send ON of OFF, that’s it because it’s a switch
Thanks for pointing me in the right direction, but I still can’t get it working.
I created the Generic MQTT thing and added a switch channel to it. Into the filed “MQTT command topic” I entered the topic (“winthing/keyboard/commands/press_keys”).
Then I created the following item:
Switch test "test" <switch> [ "Switchable" ] {channel="mqtt:topic:c4c27146:entertain"}
Anything else required? So far no messages are getting send, when the switch is toggled. The MQTT Broker was already autodiscovered and added as thing.
I only see the toggle event fof the switch in the logs.
2018-12-22 22:52:38.477 [ome.event.ItemCommandEvent] - Item 'test' received command ON
2018-12-22 22:52:38.487 [nt.ItemStatePredictedEvent] - test predicted to become ON
2018-12-22 22:52:38.500 [vent.ItemStateChangedEvent] - test changed from OFF to ON
2018-12-22 22:52:39.946 [ome.event.ItemCommandEvent] - Item 'test' received command OFF
2018-12-22 22:52:39.952 [nt.ItemStatePredictedEvent] - test predicted to become OFF
2018-12-22 22:52:39.965 [vent.ItemStateChangedEvent] - test changed from ON to OFF