Logic Machine Forum
Previous State - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Previous State (/showthread.php?tid=347)



Previous State - XSPA2474KW - 17.07.2016

Hi

I need a script to control the previous state of an object 1/1/1.
1/1/1 is off or on
If 1/1/2 is on then 1/1/1 is on and when 1/1/2 became off then 1/1/1 will be in the last status before 1/1/2 was on.

Thanks


RE: Previous State - Erwin van der Zwart - 17.07.2016

Hi,

You can store the original value of 1/1/1 into the storage when 1/1/2 is change to 1, when 1/1/2 goes to 0 then grab previous saved state of 1/1/1 from storage and write that value to 1/1/1

To store use:

storage.set('state', grp.getvalue('1/1/1'))

To write back use:

grp.write('1/1/1', storage.get('state'))

BR, 

Erwin


RE: Previous State - admin - 18.07.2016

Create an event script attached to 1/1/2:

Code:
output '1/1/1'
storage_key = 'prev_value'

curr = event.getvalue()
prev = storage.get(storage_key)

if curr ~= prev then
  grp.write(output, prev)
  storage.set(storage_key, curr)
end



RE: Previous State - Frank68 - 15.10.2020

(18.07.2016, 06:39)admin Wrote: Create an event script attached to 1/1/2:

Code:
output '1/1/1'
storage_key = 'prev_value'

curr = event.getvalue()
prev = storage.get(storage_key)

if curr ~= prev then
  grp.write(output, prev)
  storage.set(storage_key, curr)
end

Perfect is good , but if I need to initialize the storage  with the current value , neede to create manualy a script to memorize it , is correct ?

Thank's in adavantage


RE: Previous State - admin - 15.10.2020

Just run the script once and it will set the storage value. Empty storage value is nil.


RE: Previous State - XSPA2474KW - 01.04.2021

Hello Mr. Erwin,

I have downloaded the Wiser app from Play store and I tried to create an account.

I followed the steps according to the introductions and in the last step after the MAC entering it returns me an error "Wiser for KNX not known by the system. Contact the technical support team to continue."

Thanks in advance for your help!


RE: Previous State - Daniel - 01.04.2021

(01.04.2021, 07:33)XSPA2474KW Wrote: Hello Mr. Erwin,

I have downloaded the Wiser app from Play store and I tried to create an account.

I  followed the steps according to the introductions and in the last step after the MAC entering it returns me an error "Wiser for KNX not known by the system. Contact the technical support team to continue."

Thanks in advance for your help!

Erwin or anybody here will not be able to help you. Contact SE support. You probably have old HW which is not registered.

PS. Please do not mix up threads with different questions. It is impossible to find anything later.


RE: Previous State - XSPA2474KW - 01.04.2021

Can you suggest to me someone who is responsible from SE support?

Thanks


RE: Previous State - Erwin van der Zwart - 01.04.2021

The official path for support is contacting your customer care center (ccc) in your country, they will create a case that can be escalated to the highest level of support.

I answered your PM, just as Daniel suspect i guess you have a very old HW1 homeLYnk that is not known in the system, it can be added manually if needed but requires some steps to create the open VPN key of your device that needs to be added to our cloud.


RE: Previous State - Erwin van der Zwart - 01.04.2021

Solved:

Seems to be a spaceLYnk.. Wiser for KNX remote cannot be used on a SL, you need a Wiser for KNX for that ..