Page 1 of 1
mqtt domoticz/in with blinds percentage
Posted: Monday 06 April 2020 14:51
by bend94
Hi,
Hope everything is good for you !
Just a question, i have blinds percentage devices.
How to update the level with a mqtt publish command ?
i tried that to open my blind to 35%
sudo mosquitto_pub -h localhost -m '{ "idx" : "35", "Set Level" : "35" }' -t "domoticz/in"
but i catch this error in domoticz
Error: MQTT: Invalid data received!
please help
Thx
Re: mqtt domoticz/in with blinds percentage
Posted: Monday 06 April 2020 14:57
by FireWizard
Hi,
I assume you want to send the "Set Level" as a string to Domoticz.
Change
Code: Select all
sudo mosquitto_pub -h localhost -m '{ "idx" : "35", "Set Level" : "35" }' -t "domoticz/in"
into:
Code: Select all
sudo mosquitto_pub -h localhost -m '{ "idx" : "35", "svalue" : "35" }' -t "domoticz/in"
Regards
Re: mqtt domoticz/in with blinds percentage
Posted: Monday 06 April 2020 16:18
by bend94
hi FireWizard
Thanks for your reply
in fact this is not a string, as it is a Blind percentage, see below , i want to update the level with MQTT (10%, 20%,...)

- BlindPercentage.PNG (15.3 KiB) Viewed 905 times
Thanks for your help
Regards
Re: mqtt domoticz/in with blinds percentage
Posted: Monday 06 April 2020 21:33
by FireWizard
Hi,
Is the selector switch an option?
To trigger it, see:
https://www.domoticz.com/forum/viewtopic.php?t=20906 (last post)
Regards
Re: mqtt domoticz/in with blinds percentage
Posted: Monday 06 April 2020 21:50
by waaren
bend94 wrote: ↑Monday 06 April 2020 16:18
in fact this is not a string, as it is a Blind percentage, see below , i want to update the level with MQTT (10%, 20%,...)
mosquitto_pub -m '{"command" : "switchlight", "idx": 35, "switchcmd": "Set Level" , "level": 35 }' -t domoticz/in
Re: mqtt domoticz/in with blinds percentage
Posted: Tuesday 07 April 2020 9:21
by bend94
hi
thanks for your help
it is ok now with that command
just one additionnal info (in case someone is looking for the same cmd)
sudo mosquitto_pub -h localhost -m '{"command": "switchlight","idx": 35,"switchcmd": "Set Level","level" : 1 }' -t "domoticz/in"
level seems to be between 0 and 15, that is to say 0 = 0% and 15 = 100%
best regards
Re: mqtt domoticz/in with blinds percentage
Posted: Tuesday 07 April 2020 19:06
by waaren
bend94 wrote:hi
thanks for your help
it is ok now with that command
just one additionnal info (in case someone is looking for the same cmd)
sudo mosquitto_pub -h localhost -m '{"command": "switchlight","idx": 35,"switchcmd": "Set Level","level" : 1 }' -t "domoticz/in"
level seems to be between 0 and 15, that is to say 0 = 0% and 15 = 100%
best regards
I tested this on a blind percentage device and there it is a one to one relation. So sending 65 results in the blind to be set at 65%.
Verstuurd vanaf mijn ONEPLUS A6003 met Tapatalk