mqtt : "stop" value implemented for blinds

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
mrelfire
Posts: 40
Joined: Wednesday 03 August 2016 15:12
Target OS: Windows
Domoticz version:
Contact:

mqtt : "stop" value implemented for blinds

Post by mrelfire »

Is it possible to have the "Stop" value implemented to allow blinds to be manipulated with mqtt ?
example :

Code: Select all

2018-08-25 10:11:19.678 MQTT: Topic: domoticz/in, Message: {"command":"switchlight","idx":149,"switchcmd":"Stop"}
today we have this error

Code: Select all

2018-08-25 10:11:19.678 Error: MQTT: Invalid data received!
so we have the same command either in http or mqtt ?

thanks in advance
mrelfire
Posts: 40
Joined: Wednesday 03 August 2016 15:12
Target OS: Windows
Domoticz version:
Contact:

Re: mqtt : "stop" value implemented for blinds

Post by mrelfire »

I have proposed" if it is possibl"e to had the "stop" value , but perhaps people can have some other suggestions ?

@developpers => is it complicated ? feasible ?

thans in advance ;)
ben53252642
Posts: 543
Joined: Saturday 02 July 2016 5:17
Target OS: Linux
Domoticz version: Beta
Contact:

Re: mqtt : "stop" value implemented for blinds

Post by ben53252642 »

You could achieve stop using levels via MQTT (although I agree with your proposal).

viewtopic.php?f=68&t=23607&start=20#p188171

Look at the Node-Red example for the Xiaomi button (import it).

There may be levels for the blind switch you can simply send, eg an to turn a simple on off switch on would usually be level 255 and to turn it off would usually be level 0 (can vary).

Is there a level number for the stop?
Unless otherwise stated, all my code is released under GPL 3 license: https://www.gnu.org/licenses/gpl-3.0.en.html
mrelfire
Posts: 40
Joined: Wednesday 03 August 2016 15:12
Target OS: Windows
Domoticz version:
Contact:

Re: mqtt : "stop" value implemented for blinds

Post by mrelfire »

unfortunately no.
"We" need a "stop" implementation ;)
ben53252642
Posts: 543
Joined: Saturday 02 July 2016 5:17
Target OS: Linux
Domoticz version: Beta
Contact:

Re: mqtt : "stop" value implemented for blinds

Post by ben53252642 »

mrelfire wrote: Sunday 02 September 2018 19:12 unfortunately no.
"We" need a "stop" implementation ;)
If you really need it, you can indeed do it via levels.

Create a selector switch then map it using Lua to stop the blind, control the selector switch via MQTT.

Not the easiest way I know but it would work.
Unless otherwise stated, all my code is released under GPL 3 license: https://www.gnu.org/licenses/gpl-3.0.en.html
mrelfire
Posts: 40
Joined: Wednesday 03 August 2016 15:12
Target OS: Windows
Domoticz version:
Contact:

Re: mqtt : "stop" value implemented for blinds

Post by mrelfire »

I have 15 blinds. followinf your suggestion I will have to create 15 others switches for levels , wich I map to my first 15 ids => a nightmare
now I have as script which swith for open on mqtt calls, and for off on https calls

not clean but in waiting as you sayed
mrelfire
Posts: 40
Joined: Wednesday 03 August 2016 15:12
Target OS: Windows
Domoticz version:
Contact:

Re: mqtt : "stop" value implemented for blinds

Post by mrelfire »

perhaps it is a bug, no clues => should I move it to the bug forum ?
any suggestions ?
User avatar
jvdz
Posts: 2269
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: mqtt : "stop" value implemented for blinds

Post by jvdz »

Was my answer in this thread not sufficient?
viewtopic.php?f=28&t=24600
It doesn't look like a bug but more a feature request.... which means somebody needs to have the urge to code it.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
mrelfire
Posts: 40
Joined: Wednesday 03 August 2016 15:12
Target OS: Windows
Domoticz version:
Contact:

Re: mqtt : "stop" value implemented for blinds

Post by mrelfire »

unfortunately "Toggle" or "Set Level" doesn't stop a blind up or down ;)

so perhaps you are right, "we" need some code :)
mrelfire
Posts: 40
Joined: Wednesday 03 August 2016 15:12
Target OS: Windows
Domoticz version:
Contact:

Re: mqtt : "stop" value implemented for blinds

Post by mrelfire »

Is it a bug ? => do I have to do a request on github please ?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: mqtt : "stop" value implemented for blinds

Post by waaren »

mrelfire wrote: Sunday 09 December 2018 8:13 Is it a bug ? => do I have to do a request on github please ?
I have setup something like what you need with the use of one domoticz uservariable and a dzVents script. Would that help you ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
mrelfire
Posts: 40
Joined: Wednesday 03 August 2016 15:12
Target OS: Windows
Domoticz version:
Contact:

Re: mqtt : "stop" value implemented for blinds

Post by mrelfire »

would you mind to give me the link so I can test it please ?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: mqtt : "stop" value implemented for blinds

Post by waaren »

mrelfire wrote: Sunday 09 December 2018 9:04 would you mind to give me the link so I can test it please ?
This should do it.

Code: Select all

--[[    this scripts handles commmunication from MQTT to domoticz uservar
        mosquitto_pub -r -t domoticz/in -m '{"command":"setuservariable","idx":61,"value":"1099"}'
        
        change 61 to the idx of your (type string) domoticz uservariable 
        change 1099 to the idx of your blind
        
        this dzVents script will pickup the variable and stop the blind 
       
]] --

local blindStopperVariableIDX = 61

return { 
            on      =   {   variables       =   { blindStopperVariableIDX }},
                  
            logging =   {   level           =   domoticz.LOG_DEBUG,
                            marker          =   "MQTT Blind"    },
    
    execute = function(dz, item, info )
       
        _G.logMarker             = info.scriptName                  -- sets the logmarker for dz.log
    
        local function logWrite(str,level)
            dz.log(str,level or dz.LOG_DEBUG)
        end
        
        blind = dz.devices(tonumber(item.value))
        blind.stop()
        logWrite("device " .. blind.name .. " stopped") 
    end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
mrelfire
Posts: 40
Joined: Wednesday 03 August 2016 15:12
Target OS: Windows
Domoticz version:
Contact:

Re: mqtt : "stop" value implemented for blinds

Post by mrelfire »

I am confused, how you trigger this script when you do a mqtt action, this is quite strange and confusing to make a generic to bypass a code limitation.
I manage to see your point but not a clue to implement it and make it generic
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest