This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

How to get value from an object?
#1
Hi, 
I have created a LM script to control some light functionality manually and I am linking that to a dimming function on a wall switch. The wall switch is calling the address 0/5/27 (DTP diming control) and an event-based script is managing the lights from the LM.
The wall switch is sending two possible values and I cannot capture that from the script. I thought that using event.getvalue() will get me that data, but it only gives me true or false.
When looking on the group address info ´Last Value´ I can see the two possible values.
Could you please let me know how to capture that?
Thanks!
Reply
#2
Your event script is triggered not by your dimming object
------------------------------
Ctrl+F5
Reply
#3
(02.10.2024, 11:36)Daniel Wrote: Your event script is triggered not by your dimming object

i don´t fully understand.

Is there a way of getting the ´Last value´ info of that object? when calling the script, the wall switch sends that value on the ´info´ column of the diagnostics view
Reply
#4
Yes, when you use event script and event.getvalue() then you will get last value from the object which triggers the event script. In your case is a 1bit object. If you want the dimming value do the same for 3bit dimming object. Alternatively you can do value = grp.getvalue('1/1/1') but this is will be checked each time a script is triggered(in case of event)
------------------------------
Ctrl+F5
Reply
#5
(02.10.2024, 11:45)Daniel Wrote: Yes, when you use event script and event.getvalue() then you will get last value from the object which triggers the event script. In your case is a 1bit object. If you want the dimming value do the same for 3bit dimming object.  Alternatively you can do value = grp.getvalue('1/1/1') but this is will be checked each time a script is triggered(in case of event)

Thank you for your prompt response but I am afraid I don´t get it. On the one hand, you mention doing the same for 3bit dimming objects but I don´t know what you are referring to. 
On the other hand, you talk about getting the value from 1/1/1 which I also don´t understand since when doing that I only get true or false
Reply
#6
Share your script
------------------------------
Ctrl+F5
Reply
#7
(02.10.2024, 12:59)Daniel Wrote: Share your script

my script is not relevant as I want to make decisions in my script based on the value I want to capture FROM that script. The issue is that I am not able to capture that value. My script calls another one from the user library, it has only one line.
Reply
#8
see this
https://www.screencast.com/t/DS5uT0acux
------------------------------
Ctrl+F5
Reply
#9
(02.10.2024, 13:17)Daniel Wrote: see this
https://www.screencast.com/t/DS5uT0acux

very good idea and self-explanatory de video.
Now I am clear. What I didn´t understand is that why I should change the DTP when I have already had one, the surprise is that the one in ETS is not synched in LM... Why this happens?
thanks again, you saved me lot of time.
Reply
#10
Well this is not possible, you must import the ets project to LM for it to be updated.
------------------------------
Ctrl+F5
Reply


Forum Jump: