for some reason i cannot get this to work correctly and i know there is a trick that i am missing. i’ve created a reactor to hadle my notifications in a consistent way. that reactor has a variable “input” that is exported. on other reactors, i set that variable (via a davice action → set variable) and then the notification reactor does it’s thing and messages, texts, etc. depending on the alert level. the issue I have is on repeated notifications, since the input string doesn’t really change, the reactor does not trigger a new alert. this is what i see in the logic summary:
Events
2020-05-10 10:59:32: Reactor startup (Luup reload)
2020-05-10 10:59:32: Starting (Luup Startup/Reload)
2020-05-10 10:59:33: Sensor update starting
2020-05-10 10:59:33: Sensor update completed; 0.049s
2020-05-10 10:59:58: Variable "input" set to "[\"notification\",\"this is a notify message\"]"; was "[\"notification\",\"this is a notify message\"]"
2020-05-10 10:59:59: Sensor update starting
2020-05-10 10:59:59: Sensor update completed; 0.034s
2020-05-10 11:00:11: Variable "input" set to "[\"notification\",\"this is a notify message\"]"; was "[\"notification\",\"this is a notify message\"]"
2020-05-10 11:00:12: Sensor update starting
2020-05-10 11:00:12: Sensor update completed; 0.035s
i tried using a device state condition on the “input” variable (using the this Reactor Sensor as the device), but it doesn’t seem to pick up changes. If i look at the variable in the condiftions tab, it shows “Current value: (not set)”, though in the variables tab it is set.
Logic detail below:
```
*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
Version: 3.6develop-20128 config 20070 cdata 20045 ui 20085 pluginDevice 181 LuaXP 1.0.2enh
System: Vera version 1.7.4970 (7.31) on Sercomm G450 ID 36 (Vera Plus); loadtime 1589122743/1589122772; systemReady 1589122777; ALTUI v2.49
Env: Lua 5.1; JSON dkjson 2.5+LPeg; UnsafeLua=nil/true
Local time: 2020-05-10T11:00:19-0400; DST=1; Nags Head, North Carolina United States; formats %d/%m/%Y %H:%M:%S
House mode: plugin 1; system 1; tracking on
Sun data: {"source":"int","civdawn":1589103150,"nautdawn":1589101102,"sunset":1589155005,"nautdusk":1589158742,"stamp":2020131,"latitude":35.858629,"astrodusk":1589160934,"longitude":-75.570285,"civdusk":1589156693,"astrodawn":1589098910,"sunrise":1589104838}
Geofence: not running
RS: ,,1589071548,1589071868,1589071950,1589072676,1589072774,1589073781,1589122772
NS: 0:X,1589067360:U
************************************************************************************************************************************
RS-NOTIFICATIONS (#187)
Version 20045.81 05/10/20 10:56:00
Message/status: Not tripped
Variable/expressions
0: input [last "[\"notification\",\"this is a notify message\"]"(string)] (exported)
1: convertedInput if( len(input) > 0, unstringify(input), "BLANK") [last ["notification","this is a notify message"](table)]
2: alertLevel if( len(input) > 0, upper(tostring(convertedInput[1])), "BLANK") [last "NOTIFICATION"(string)]
3: theMessage if( len(input) > 0, upper(tostring(convertedInput[2])), "BLANK") [last "THIS IS A NOTIFY MESSAGE"(string)]
4: allowNotifications true [last true(boolean)]
5: allowDebug true [last true(boolean)]
Condition group "Alert Handler" (NUL) false as of 22:41:13 <root>
Z-F-group "NEW ALERT" (AND) false as of 10:27:33 <grprgfkss4>
| &-F-service (self) (-1) urn:toggledbits-com:serviceId:ReactorValues/input update [1589122173 => 1589122745 at 10:59:33; F/F as of 10:49:36/10:49:36] <condrhcu5qf>
| &-F-var alertLevel change ,Alert [blank => notification at 10:49:34; F/F as of 10:28:00/10:28:00] <condrgnot3d>
Z-F-group "NEW NOTIFICATION" (AND) false as of 10:49:36 <grprgfmfds>
| &-T-var allowNotifications = true [true at 22:28:24; T/T as of 22:28:24/22:28:24] <condrgna221>
| &-F-service (self) (-1) urn:toggledbits-com:serviceId:ReactorValues/input update [1589122173 => 1589122745 at 10:59:33; F/F as of 10:49:36/10:49:36] <condrhcv8b2>
| &-T-var alertLevel change ,Notification [blank => notification at 10:49:34; T/T as of 10:49:34/10:49:34] <condrgfmgc1>
Z-F-group "DEBUG MESSAGES" (AND) false as of 22:31:26 <grprgncqct>
| &-F-service (self) (-1) urn:toggledbits-com:serviceId:ReactorValues/input update [1589122173 => 1589122745 at 10:59:33; F/F as of 10:49:36/10:49:36] <condrhcvwjx>
| &-F-var alertLevel change ,Debug [blank => notification at 10:49:34; F/F as of 22:45:53/22:45:53] <condrgnqdv6>
| &-T-var allowDebug = true [true at 22:31:26; T/T as of 22:31:26/22:31:26] <condrgncsy6>
Activity grprgfmfds.true
Notify method SM nid 3: users message "{ \"REACTOR NOTIFICATION \\n=======================\\n\\n MESSAGE:\\n\" + theMessage + \"\\n\\n————————————————\\nTime: \" + strftime('%H:%M:%S %m-%d-%Y') }"; SMTPServer="smtp.gmail.com"; SMTPPort="465"; SMTPSender="REACTOR <my@email.com>"; SMTPDefaultRecipient="REACTOR <my@email.com>"; SMTPDefaultSubject="REACTOR EMAIL"; SMTPUsername="my@email.com"; SMTPPassword="****"; SSL opt {"verify":"none","mode":"client","protocol":"tlsv1"}
Activity grprgfkss4.true
Notify method SM nid 2: users message "{ \"REACTOR ALERT \\n=======================\\n\\n MESSAGE:\\n\" + theMessage + \"\\n\\n--------------------------------\\nTime: \" + strftime('%H:%M:%S %m-%d-%Y') }"; SMTPServer="smtp.gmail.com"; SMTPPort="465"; SMTPSender="REACTOR <my@email.com>"; SMTPDefaultRecipient="REACTOR <my@email.com>"; SMTPDefaultSubject="REACTOR EMAIL"; SMTPUsername="my@email.com"; SMTPPassword="****"; SSL opt {"verify":"none","mode":"client","protocol":"tlsv1"}
Notify method SM nid 4: users message "{ \"REACTOR ALERT: \" + theMessage + \" Time: \" + strftime('%H:%M:%S %m-%d-%Y') }"; SMTPServer="smtp.gmail.com"; SMTPPort="465"; SMTPSender="REACTOR <my@email.com>"; SMTPDefaultRecipient="REACTOR <my@email.com>"; SMTPDefaultSubject="REACTOR EMAIL"; SMTPUsername="my@email.com"; SMTPPassword="****"; SSL opt {"verify":"none","mode":"client","protocol":"tlsv1"}
Activity grprgncqct.true
Notify method SM nid 5: users message "{“debug message: “ + theMessage}"; SMTPServer="smtp.gmail.com"; SMTPPort="465"; SMTPSender="REACTOR <my@email.com>"; SMTPDefaultRecipient="REACTOR <my@email.com>"; SMTPDefaultSubject="REACTOR EMAIL"; SMTPUsername="my@email.com"; SMTPPassword="****"; SSL opt {"verify":"none","mode":"client","protocol":"tlsv1"}
Events
2020-05-10 10:59:32: Reactor startup (Luup reload)
2020-05-10 10:59:32: Starting (Luup Startup/Reload)
2020-05-10 10:59:33: Sensor update starting
2020-05-10 10:59:33: Sensor update completed; 0.049s
2020-05-10 10:59:58: Variable "input" set to "[\"notification\",\"this is a notify message\"]"; was "[\"notification\",\"this is a notify message\"]"
2020-05-10 10:59:59: Sensor update starting
2020-05-10 10:59:59: Sensor update completed; 0.034s
2020-05-10 11:00:11: Variable "input" set to "[\"notification\",\"this is a notify message\"]"; was "[\"notification\",\"this is a notify message\"]"
2020-05-10 11:00:12: Sensor update starting
2020-05-10 11:00:12: Sensor update completed; 0.035s
Watches
Device #187 RS-NOTIFICATIONS service urn:toggledbits-com:serviceId:ReactorSensor variable TestHouseMode
Device #187 RS-NOTIFICATIONS service urn:toggledbits-com:serviceId:ReactorSensor variable cdata
Device #187 RS-NOTIFICATIONS service urn:toggledbits-com:serviceId:ReactorSensor variable TestTime