Page 2 of 6
Re: Mode-selector / multistate device
Posted: Thursday 24 December 2015 20:46
by StanHD
We really like this:-
Made a Blockly to read the states:-
Works great, thanks Devs.
Merry Christmas Everyone
Re: Mode-selector / multistate device
Posted: Thursday 07 January 2016 23:40
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
Re: Mode-selector / multistate device
Posted: Saturday 09 January 2016 16:38
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.
Re: Mode-selector / multistate device
Posted: Sunday 10 January 2016 12:45
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...
Re: Mode-selector / multistate device
Posted: Sunday 10 January 2016 20:25
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.
Re: Mode-selector / multistate device
Posted: Sunday 10 January 2016 21:20
by bizziebis
Set level 10, set level 20 etc.
Re: Mode-selector / multistate device
Posted: Sunday 10 January 2016 21:35
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...
Re: Mode-selector / multistate device
Posted: Monday 11 January 2016 7:23
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)
Re: Mode-selector / multistate device
Posted: Monday 11 January 2016 13:34
by raym
bizziebis wrote:Set level 10, set level 20 etc.
Just re-tested in blocky and not working for me.
Re: Mode-selector / multistate device
Posted: Monday 11 January 2016 19:13
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'
Re: Mode-selector / multistate device
Posted: Monday 11 January 2016 22:18
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?
Re: Mode-selector / multistate device
Posted: Monday 11 January 2016 22:33
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.
Re: Mode-selector / multistate device
Posted: Monday 11 January 2016 22:47
by cgaudry
It is the same in blockly :
- ece7f956-a355-11e5-979f-e445657b9a69.png (25.74 KiB) Viewed 8104 times
- ca6c7e7e-a355-11e5-976f-57f282c32b4e.png (21.33 KiB) Viewed 8104 times
Re: Mode-selector / multistate device
Posted: Wednesday 13 January 2016 10:42
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.
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
Re: Mode-selector / multistate device
Posted: Wednesday 13 January 2016 17:33
by remb0
a nice it's the :
Re: Mode-selector / multistate device
Posted: Wednesday 13 January 2016 22:58
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.
Re: Mode-selector / multistate device
Posted: Thursday 14 January 2016 10:08
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 : :;|<>
Re: Mode-selector / multistate device
Posted: Thursday 14 January 2016 14:10
by jcjames13009
Now my heating system is managed using selector switch
But I can't see it in ImperiHome
Hope it'll be available soon.
Thanks again to the developpers
JC
Re: Mode-selector / multistate device
Posted: Thursday 14 January 2016 14:15
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
Re: Mode-selector / multistate device
Posted: Thursday 14 January 2016 14:34
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