Hmmm, papoo asked for:
not to receive a notification every minute as long as condition not changed
So, in your code this test, " if dz.data.state ~= conditionDeviceState then" must send the notification, not only reset the state.
For this I said that the time isn't important if you want to ...
Search found 5 matches
- Monday 11 June 2018 10:26
- Forum: dzVents
- Topic: last notification in dzVents persistent data?
- Replies: 5
- Views: 1172
- Sunday 10 June 2018 22:56
- Forum: dzVents
- Topic: last notification in dzVents persistent data?
- Replies: 5
- Views: 1172
Re: last notification in dzVents persistent data?
The time isn't the problem, I think that you must check if the condition changed or not, so you only need to store the state in persistent data, not the time.
- Sunday 10 June 2018 22:52
- Forum: dzVents
- Topic: User Variable not updating as expected
- Replies: 4
- Views: 1579
Re: User Variable not updating as expected
I think that also with performance in mind, to check all rooms for temperature in each call of the script is a hard job in cpu terms.
I think that the use of one persistent variable is the best way to do it. Of course use only one script for all rooms.
At last, I think that persistent variables ...
I think that the use of one persistent variable is the best way to do it. Of course use only one script for all rooms.
At last, I think that persistent variables ...
- Sunday 10 June 2018 22:42
- Forum: dzVents
- Topic: (SOLVED) Use of lua sets (dictionary) in dzVents persistent data
- Replies: 2
- Views: 776
(SOLVED) Re: Use of lua sets (dictionary) in dzVents persistent data
Many thanks.
Even before read your post I suspected that the rigth syntax may be the one that you say, and off course it works like a charm.
Regards.
Even before read your post I suspected that the rigth syntax may be the one that you say, and off course it works like a charm.
Regards.
- Saturday 09 June 2018 10:28
- Forum: dzVents
- Topic: (SOLVED) Use of lua sets (dictionary) in dzVents persistent data
- Replies: 2
- Views: 776
(SOLVED) Use of lua sets (dictionary) in dzVents persistent data
I have a script that need to control internally the state of some dummy devices and store it on persisten data. In lua I can do this:
estado = {['COMPLETO'] = false, ['CESPED'] = true, ['GOTEOS'] = false }
print(estado['CESPED'])
true
In the dzVents script I use code like this:
data ...
estado = {['COMPLETO'] = false, ['CESPED'] = true, ['GOTEOS'] = false }
print(estado['CESPED'])
true
In the dzVents script I use code like this:
data ...