Ask our Experts
Didn't find what you are looking for? Ask our experts!
Share Your Feedback – Help Us Improve Search on Community! Please take a few minutes to participate in our Search Feedback Survey. Your insights will help us deliver the results you need faster and more accurately. Click here to take the survey
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.
Search in
Posted: 2014-11-03 07:05 AM . Last Modified: 2024-07-15 12:04 AM
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!
You’ve reached the end of your document
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.