SpaceLogic KNX Forum
Schneider Electric SpaceLogic KNX forum to get support and share knowledge including selection, installation and troubleshooting for spaceLYnk, Wiser for KNX, eConfigure KNX, SpaceLogic KNX Hybrid module and other topics.
Link copied. Please paste this link to share this article on your social media post.
Hi colleagues,
I want to configure schedulers linked to the RTC modes in a "User friendly" way.
In the scheduler, tje value to set different Comfort, Night or standby modes are numbers, for End User that is not comprehensive.
What I planed:
- Schedulers with 14 bytes variables and string value with the values: COMFORT, NIGHT or STANDBY
- To convert these strings to the corresponding value (1,2,3) I plan an script... but then my question appears:
How can I use a conditional and string?
Tried:
if (value == 'COMFORT') then
......
end
But when saving, system rejects it. I tried with "COMFORT" also.
How can this be done?
Do you have any other idea how to do the same in a User Friendly way?
Thanks a lot
Link copied. Please paste this link to share this article on your social media post.
Hi Jorge,
I tested quickly this script:
value = 'COMFORT'
if (value == 'COMFORT') then
log("Test1: OK value = COMFORT")
else
log("Test1: NOK value != COMFORT: value =",value)
end
value = 'NIGHT'
if (value == 'COMFORT') then
log("Test2: OK value = COMFORT")
else
log("Test2: NOK value != COMFORT: value =",value)
end
=> it works: see screenshot of log page.
So I don't understand your issue?
Regards
Lionel
Link copied. Please paste this link to share this article on your social media post.
Hi,
or you can do it via Lua table with simple mapping:
local mapping = { COMFORT = 1, NIGHT = 2, STANDBY = 3 }
realValue = mapping[value]
or more general mapping if you need to do some code with mapping
local mapping = {
COMFORT = function()
-- some coding like 'local a = 5; return 1'
end,
NIGHT = function()
-- some coding like 'grp.update("1/1/20", 18); return 2'
end,
STANDBY = function()
-- some coding like 'log("hurray, it's working"); return 3'
end,
}
realValue = mapping[value]()
Link copied. Please paste this link to share this article on your social media post.
Thanks colleagues for helpful answers.
Finally I did it with "Custom Values". I'm learning by doing!
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.