Mode-selector / multistate device

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

User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Mode-selector / multistate device

Post by StanHD »

We really like this:-

Image

Made a Blockly to read the states:-

Image

Works great, thanks Devs.

Merry Christmas Everyone :D
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
pepeEL

Re: Mode-selector / multistate device

Post by pepeEL »

Hello all
I am beginner...

Please explaine me how i can write script or set to button level other function/command ?

For example as for command ON and OFF.
I want maybe use this to control my AV Reciver and i want have function:
1. ON/ OFF (it is ok i know how)
ON - http://DENON_IP/MainZone/index.put.asp?cmd0=PutZone_OnOff%2FON
OFF - http://DENON_IP/MainZone/index.put.asp?cmd0=PutZone_OnOff%2FOFF

But when i select action ON and OFF icon button is not active... Only can OFF by leve name OFF

2. Select INPUT (defined by me)

also by http

3. Control volume up and down

also by http but must be not button than only PUSH BUTTON

Is any chance to correct it in domoticz to user by set level can also select type button:
Button ON/OFF
or
PUSH BUTTON

and correct also in Domoticz when user create level also with create can set command to this level action on (Should start with http:// or script://)

and add option to set display text as in virtual switch text ?? Please developer to add this features....



Please help
cgaudry
Posts: 8
Joined: Thursday 14 May 2015 0:50
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Rambouillet, France
Contact:

Re: Mode-selector / multistate device

Post by cgaudry »

I'm still working on it :
- add a parameter to hide 'Off' "level" ;
- add an action to execute when a "level" is selected.

These features should be available next week.
User avatar
remb0
Posts: 499
Joined: Thursday 11 July 2013 22:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Mode-selector / multistate device

Post by remb0 »

whats the lua coding for changing the selector?
The only code worked is: commandArray['Fan']='Off'

I have a selector 'Fan'
it had 4 states: off, _1 , _2, _3

What is the commandArray for changing my selector to _3 (value 30) ?

I can control them manually and check what the value is, but changing in a script doesn't work...
raym
Posts: 81
Joined: Tuesday 03 November 2015 5:07
Target OS: Linux
Domoticz version: beta
Contact:

Re: Mode-selector / multistate device

Post by raym »

remb0 wrote:whats the lua coding for changing the selector?
The only code worked is: commandArray['Fan']='Off'

I have a selector 'Fan'
it had 4 states: off, _1 , _2, _3

What is the commandArray for changing my selector to _3 (value 30) ?

I can control them manually and check what the value is, but changing in a script doesn't work...
I'm also curious to know this. I'd like to be able to set specific modes programmatically - LUA is OK but preferably with blocky.
User avatar
bizziebis
Posts: 182
Joined: Saturday 19 October 2013 14:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8805
Location: The Netherlands
Contact:

Re: Mode-selector / multistate device

Post by bizziebis »

Set level 10, set level 20 etc.
raym
Posts: 81
Joined: Tuesday 03 November 2015 5:07
Target OS: Linux
Domoticz version: beta
Contact:

Re: Mode-selector / multistate device

Post by raym »

bizziebis wrote:Set level 10, set level 20 etc.
Thanks. I'm sure I tried that but it didn't seem to work for me. I'll take another look...
User avatar
remb0
Posts: 499
Joined: Thursday 11 July 2013 22:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Mode-selector / multistate device

Post by remb0 »

commandArray['Fan']= 'set level 30' doesn't work for me either. name of device is correct. and it had til level 40 so the level also exist.
in blocky it works. but lua don't (I hope I made an stupid fault)
raym
Posts: 81
Joined: Tuesday 03 November 2015 5:07
Target OS: Linux
Domoticz version: beta
Contact:

Re: Mode-selector / multistate device

Post by raym »

bizziebis wrote:Set level 10, set level 20 etc.
Just re-tested in blocky and not working for me.
User avatar
bizziebis
Posts: 182
Joined: Saturday 19 October 2013 14:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8805
Location: The Netherlands
Contact:

Re: Mode-selector / multistate device

Post by bizziebis »

remb0 wrote:commandArray['Fan']= 'set level 30' doesn't work for me either. name of device is correct. and it had til level 40 so the level also exist.
in blocky it works. but lua don't (I hope I made an stupid fault)
That's strange, I use it like this and it works:

Code: Select all

	commandArray['Selector']='Set Level 30'
raym
Posts: 81
Joined: Tuesday 03 November 2015 5:07
Target OS: Linux
Domoticz version: beta
Contact:

Re: Mode-selector / multistate device

Post by raym »

bizziebis wrote:
remb0 wrote:commandArray['Fan']= 'set level 30' doesn't work for me either. name of device is correct. and it had til level 40 so the level also exist.
in blocky it works. but lua don't (I hope I made an stupid fault)
That's strange, I use it like this and it works:

Code: Select all

	commandArray['Selector']='Set Level 30'
Would you mind trying in blocky too please to confirm what I'm seeing?
cgaudry
Posts: 8
Joined: Thursday 14 May 2015 0:50
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Rambouillet, France
Contact:

Re: Mode-selector / multistate device

Post by cgaudry »

Sorry for the delay but it is :

Code: Select all

commandArray = {}
if (devicechanged['MyDeviceName'] == 'On') then
        commandArray['Test Selector']='Set Level: 20'
end
return commandArray
Where 20 is the level value, not the level name.

Code: Select all

commandArray = {}
if (devicechanged['Test Selector''] == 'Level3') then
        commandArray['MyDeviceName']='Off'
end
return commandArray
Where Level3 is a level name.
cgaudry
Posts: 8
Joined: Thursday 14 May 2015 0:50
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Rambouillet, France
Contact:

Re: Mode-selector / multistate device

Post by cgaudry »

It is the same in blockly :
ece7f956-a355-11e5-979f-e445657b9a69.png
ece7f956-a355-11e5-979f-e445657b9a69.png (25.74 KiB) Viewed 8097 times
ca6c7e7e-a355-11e5-976f-57f282c32b4e.png
ca6c7e7e-a355-11e5-976f-57f282c32b4e.png (21.33 KiB) Viewed 8097 times
mKotek
Posts: 68
Joined: Wednesday 30 December 2015 23:54
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Poland
Contact:

Re: Mode-selector / multistate device

Post by mKotek »

SQ9MDD wrote:I'm confused, how can you did this?
I have a problem with selector cant add levels simply this button doesn't work, and after save dont have any option. :shock:
I have the same problem on V2.4123 version. Is there any additional step required in order to be able to define Levels for Selector?
At the moment, all I can get is a Selector with Off level.

Update: 2016/01/14 For the benefit of others - you cannot create a dummy switch from Devices tab. You need to do this (at least for the first one) via Manual switch on Switches tab. Only then, it will work as expected. I could not understand this when reading the thread :D
Last edited by mKotek on Thursday 14 January 2016 1:56, edited 2 times in total.
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.
User avatar
remb0
Posts: 499
Joined: Thursday 11 July 2013 22:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Mode-selector / multistate device

Post by remb0 »

a nice it's the :
cgaudry
Posts: 8
Joined: Thursday 14 May 2015 0:50
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Rambouillet, France
Contact:

Re: Mode-selector / multistate device

Post by cgaudry »

You are right.
At this time you should avoid the following 4 characters : : ' | "
I will try to fix it or prevent the user to use these characters.
cgaudry
Posts: 8
Joined: Thursday 14 May 2015 0:50
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Rambouillet, France
Contact:

Re: Mode-selector / multistate device

Post by cgaudry »

This issue has been fixed this morning in beta version.
Now the following characters will be simply removed from the level name while adding or renaming it : :;|<>
User avatar
jcjames13009
Posts: 33
Joined: Monday 09 March 2015 15:24
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: France / Marseille
Contact:

Re: Mode-selector / multistate device

Post by jcjames13009 »

Now my heating system is managed using selector switch :D

But I can't see it in ImperiHome :( Hope it'll be available soon.

Thanks again to the developpers 8-)

JC
pepeEL

Re: Mode-selector / multistate device

Post by pepeEL »

But in switch selector you dont have problem with action to level?
I assigned to level acction but swich selector wrong assigned. I add to level 10 but action was run on level 0 or when i add to level 20 action is run on level 10.

Wysłane z mojego SM-G920F przy użyciu Tapatalka
User avatar
jcjames13009
Posts: 33
Joined: Monday 09 March 2015 15:24
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: France / Marseille
Contact:

Re: Mode-selector / multistate device

Post by jcjames13009 »

No issue. I use "Level Name" in lua script to control selector switch.

Something like:

Code: Select all

if (otherdevices[Heating] == 'Eco') then ...
if (otherdevices[Heating] == "Confort") then ...
if (otherdevices[Heating] == 'Off') then ...
JC
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest