rsingh
(Robert)
December 15, 2022, 1:32am
1
I am having trouble setting up a switch for my mqtt integration with a smartthings switch
I know they are communicating as I can publish the topic smartthings/switch/MQTTSwitch/state
payload: on which turns on the switch in smartthings
i am trying to make a simple switch to turn on and off the mqtt switch in home assistant, what would I type in the configuration.yaml file? do i have to make a sensor first? or just a switch like below? which I couldn’t get to work it says its unavailable? can someone check what is wrong with below?
mqtt:
switch:
unique_id: MQTT_switch
name: “MQTT Switch”
state_topic: “smartthings/switch/MQTTSwitch/state”
command_topic: “smartthings/switch/MQTTSwitch/state”
availability:
topic: “smartthings/switch/MQTTSwitch/available”
payload_on: “ON”
payload_off: “OFF”
state_on: “ON”
state_off: “OFF”
optimistic: false
qos: 0
retain: true
zoogara
(Daryl)
December 15, 2022, 3:17am
2
rsingh:
mqtt:
switch:
unique_id: MQTT_switch
name: “MQTT Switch”
state_topic: “smartthings/switch/MQTTSwitch/state”
command_topic: “smartthings/switch/MQTTSwitch/state”
availability:
topic: “smartthings/switch/MQTTSwitch/available”
payload_on: “ON”
payload_off: “OFF”
state_on: “ON”
state_off: “OFF”
optimistic: false
qos: 0
retain: true
You will need to post your code using Preformatted Text tags before anyone will likely assist. They are the </> icon in the posting toolbar.
Read this - especially item 11:
Before we begin…
This forum is not a helpdesk
The people here don’t work for Home Assistant, that’s an open source project. We are volunteering our free time to help others. Not all topics may get an answer, never mind one that helps you solve your problem.
[image]
This also isn’t a general home automation forum, this is a forum for Home Assistant and things related to it. Any question about Home Assistant, and about using things with Home Assistant, is welcome here. We can’t help you with e…
Lastly - isn’t there a SmartThings integration now which means you no longer need to use MQTT? I don’t use SmartThings so not 100%
PetrolHead
(Petrol Head)
December 15, 2022, 1:42pm
3
Have you checked your discovery prefix?