I'm having problem with publishing MQTT message to Domoticz and running script that is behind that switch.
Switch type is Selector Switch (multiple values) that behind every value has a script that is executed. This switch normally works trough Domoticz interface and script is being triggered, and this is same action I need to be executed when sending JSON trough MQTT.
this is JSON which I'm executing when I want heat to turn off
Code: Select all
mosquitto_pub -t "domoticz/in" -m '{ "command": "udevice", "idx": 66, "nvalue": 0, "svalue1": "0" }'
Both buttons are selected as active (Off and Heat)
https://ibb.co/mYe6Zm
when I click button from domoticz interface, in mqtt subscribe I get this JSON
Code: Select all
domoticz/out {
"Battery" : 255,
"LevelActions" : "script%3A///home/pi/domoticz/scripts/aircon.php%201|script%3A///home/pi/domoticz/scripts/aircon.php%20aircon_on|script%3A///home/pi/domoticz/scripts/aircon.php%20aircon_mode_dry|script%3A///home/pi/domoticz/scripts/aircon.php%20aircon_mode_cool|script%3A///home/pi/domoticz/scripts/aircon.php%20aircon_mode_heat",
"LevelNames" : "Off|On|Dry|Cool|Heat",
"LevelOffHidden" : "false",
"RSSI" : 12,
"SelectorStyle" : "0",
"description" : "",
"dtype" : "Light/Switch",
"id" : "00014092",
"idx" : 66,
"name" : "Air Condition",
"nvalue" : 0,
"stype" : "Selector Switch",
"svalue1" : "0",
"switchType" : "Selector",
"unit" : 1
}
thnx in advance