Can anyone shed some light on Error sending switch command? I have ESP8266 with reed switches set up to alert me if a window is opened. The device sends an mqtt command for a contact switch in Domoticz when the status changes. The switch is NOT getting updated and I'm getting Error sending switch command. Does my mqtt command need something else?
MQTT: Topic: domoticz/in, Message: { "command": "switchlight", "idx": 11, "switchcmd": "On" }
Error: MQTT: Error sending switch command!
Thanks
Mqtt - Error sending switch command
Moderators: leecollings, remb0
Re: Mqtt - Error sending switch command
Have you tried using the mosquitto_pub command already"
Does it work then?
mosquitto_pub -h <ip MQTT broker> -p <port MQTT broker> -u <username> -P <password> -t 'domoticz/in' -m '{ "command": "switchlight", "idx": 11, "switchcmd": "Off" }'
Does it work then?
mosquitto_pub -h <ip MQTT broker> -p <port MQTT broker> -u <username> -P <password> -t 'domoticz/in' -m '{ "command": "switchlight", "idx": 11, "switchcmd": "Off" }'
-
- Posts: 19
- Joined: Wednesday 19 July 2017 19:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: US
- Contact:
Re: Mqtt - Error sending switch command
Thanks for your response. I am using mqtt.fx to publish commands as a test. I see the published command show up in my subscribed list but am getting the error message regarding the sending switch in Domoticz. My temperature sensors are all sending mqtt commands as expected.
-
- Posts: 19
- Joined: Wednesday 19 July 2017 19:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: US
- Contact:
Re: Mqtt - Error sending switch command
OK testing a little further I found that this command works perfectly if the device is set up as a Switch but not working if Contact or Door Contact.
Is there something else I need to add to the command or is this a bug? I am on v3.8224
I'm thinking the error is coming from within Domoticz sending an mqtt response back to the device.
thanks
Is there something else I need to add to the command or is this a bug? I am on v3.8224
I'm thinking the error is coming from within Domoticz sending an mqtt response back to the device.
thanks
Re: Mqtt - Error sending switch command
I think this is not possible, if you try in the GUI you cannot toggle the door contact, you get an error there tootottka wrote:OK testing a little further I found that this command works perfectly if the device is set up as a Switch but not working if Contact or Door Contact.
-
- Posts: 19
- Joined: Wednesday 19 July 2017 19:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: US
- Contact:
Re: Mqtt - Error sending switch command
I've summarized what I am seeing, does anyone have any insights into this?
I think I have 2 issues, the first one deals with Error sending switch command on Contact
The second is that I can click on Door Contacts to change the status. I think I've been told twice that's not suppose to happen.
Light/Switch, Switch, Contact
2017-08-07 13:07:04.990 MQTT: Topic: domoticz/in, Message: { "command": "switchlight", "idx": 11, "switchcmd": "On" }
2017-08-07 13:07:04.992 Error: MQTT: Error sending switch command!
icon & status don't change
publishes to MQTT: nothing
Light/Switch, Switch, Door Contact
2017-08-07 13:07:10.894 MQTT: Topic: domoticz/in, Message: { "command": "switchlight", "idx": 12, "switchcmd": "On" }
2017-08-07 13:07:10.898 (Contact) Light/Switch (LR Window Right)
publishes to MQTT: nothing
if I click on the ICON in the switch tab, the icon changes, no MQTT generated
note: don't think I'm suppose to be able to do this?
Light/Switch, Switch, On/Off
2017-08-07 13:07:16.111 MQTT: Topic: domoticz/in, Message: { "command": "switchlight", "idx": 13, "switchcmd": "On" }
2017-08-07 13:07:16.122 (Contact) Light/Switch (switch)
publishes to MQTT: domoticz/out/Home/LivingRoom
if I click on the ICON in the switch tab, the icon changes and MQTT is generated
I think I have 2 issues, the first one deals with Error sending switch command on Contact
The second is that I can click on Door Contacts to change the status. I think I've been told twice that's not suppose to happen.
Light/Switch, Switch, Contact
2017-08-07 13:07:04.990 MQTT: Topic: domoticz/in, Message: { "command": "switchlight", "idx": 11, "switchcmd": "On" }
2017-08-07 13:07:04.992 Error: MQTT: Error sending switch command!
icon & status don't change
publishes to MQTT: nothing
Light/Switch, Switch, Door Contact
2017-08-07 13:07:10.894 MQTT: Topic: domoticz/in, Message: { "command": "switchlight", "idx": 12, "switchcmd": "On" }
2017-08-07 13:07:10.898 (Contact) Light/Switch (LR Window Right)
publishes to MQTT: nothing
if I click on the ICON in the switch tab, the icon changes, no MQTT generated
note: don't think I'm suppose to be able to do this?
Light/Switch, Switch, On/Off
2017-08-07 13:07:16.111 MQTT: Topic: domoticz/in, Message: { "command": "switchlight", "idx": 13, "switchcmd": "On" }
2017-08-07 13:07:16.122 (Contact) Light/Switch (switch)
publishes to MQTT: domoticz/out/Home/LivingRoom
if I click on the ICON in the switch tab, the icon changes and MQTT is generated
-
- Posts: 19
- Joined: Wednesday 19 July 2017 19:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: US
- Contact:
Re: Mqtt - Error sending switch command
I continued trying other ways to change my contact switch and found that I had the same problem with API calls
contact switch
192.68.0.106:8080/json.htm?type=command¶m=switchlight&idx=11&switchcmd=On
{
"message" : "Error sending switch command, check device/hardware !",
"status" : "ERROR",
"title" : "SwitchLight"
}
door contact switch
192.68.0.106:8080/json.htm?type=command¶m=switchlight&idx=12&switchcmd=On
{
"status" : "OK",
"title" : "SwitchLight"
}
switch
192.68.0.106:8080/json.htm?type=command¶m=switchlight&idx=13&switchcmd=On
{
"status" : "OK",
"title" : "SwitchLight"
}
Last thing I tried was using udevice in my API call & it worked!
192.168.0.106:8080/json.htm?type=command¶m=udevice&idx=11&nvalue=1
So at least until someone fixes this, my devices will send MQTT to mqttwarn and convert the MQTT to an API call, ugh
contact switch
192.68.0.106:8080/json.htm?type=command¶m=switchlight&idx=11&switchcmd=On
{
"message" : "Error sending switch command, check device/hardware !",
"status" : "ERROR",
"title" : "SwitchLight"
}
door contact switch
192.68.0.106:8080/json.htm?type=command¶m=switchlight&idx=12&switchcmd=On
{
"status" : "OK",
"title" : "SwitchLight"
}
switch
192.68.0.106:8080/json.htm?type=command¶m=switchlight&idx=13&switchcmd=On
{
"status" : "OK",
"title" : "SwitchLight"
}
Last thing I tried was using udevice in my API call & it worked!
192.168.0.106:8080/json.htm?type=command¶m=udevice&idx=11&nvalue=1
So at least until someone fixes this, my devices will send MQTT to mqttwarn and convert the MQTT to an API call, ugh
Who is online
Users browsing this forum: No registered users and 0 guests