So I think I’m getting somewhere but I hit another snag I can’t figure out.
I’m using $index function in a for loop and looking for when 2 conditions are met in an object from the JSON data then it should return a certain piece of info from that same object. However that’s not what’s happening. Instead, it’s returning that piece of data from all the objects that meet one of the criteria and it’s ignoring the other.
More Specific
I need it to return the candle lighting time from an object IF the date is today and the category is “candles”. However it returns the candle lighting time for all the objects that are in the “candles” category.
What am I doing wrong?
9/27/2019, 5:48:06 PM +834ms
+1ms ╔Received event [Home].test = 1569620886834 with a delay of 0ms
+181ms ║RunTime Analysis CS > 21ms > PS > 136ms > PE > 24ms > CE
+184ms ║Runtime (47280 bytes) successfully initialized in 136ms (v0.3.10f.20190822) (182ms)
+185ms ║╔Execution stage started
+190ms ║║Cancelling statement
#1’s schedules…
+193ms ║║Executed virtual command wait (1ms)
+194ms ║║Waiting for 1000ms
+1201ms ║║Sending external web request to:
www.hebcal.com/hebcal/?v=1&cfg=json&year=now&month=now&maj=on&c=on&m=72&b=18&geo=zip&zip=11230
+1319ms ║║Executed virtual command httpRequest (117ms)
+1330ms ║║12
+1331ms ║║Executed virtual command log (1ms)
+1338ms ║║[2019-09-06T19:01:00-04:00, 2019-09-07T20:29:00-04:00, 2019-09-13T18:49:00-04:00, 2019-09-14T20:18:00-04:00, 2019-09-20T18:38:00-04:00, 2019-09-21T20:06:00-04:00, 2019-09-27T18:26:00-04:00, 2019-09-28T19:54:00-04:00, 2019-09-29, 2019-09-29T18:22:00-04:00, 2019-09-30, 2019-09-30T19:51:00-04:00]
+1339ms ║║Executed virtual command log (1ms)
+1361ms ║║Comparison (date) 1569556800000 is_equal_to (date) 1569556800000 = true (2ms)
+1362ms ║║Condition
#22 evaluated true (10ms)
+1368ms ║║Comparison (dynamic) candles is_equal_to (string) candles = true (1ms)
+1370ms ║║Cancelling condition
#23’s schedules…
+1371ms ║║Condition
#23 evaluated true (8ms)
+1372ms ║║Cancelling condition
#21’s schedules…
+1373ms ║║Condition group
#21 evaluated true (state changed) (21ms)
+1375ms ║║Cancelling statement
#24’s schedules…
+1386ms ║║Calculating (string) candle lighting today is at + (string) 7:01 PM >> (string) candle lighting today is at 7:01 PM
+1390ms ║║candle lighting today is at 7:01 PM
+1391ms ║║Executed virtual command log (2ms)
+1412ms ║║Comparison (date) 1569556800000 is_equal_to (date) 1569556800000 = true (2ms)
+1413ms ║║Condition
#22 evaluated true (10ms)
+1419ms ║║Comparison (dynamic) havdalah is_equal_to (string) candles = false (2ms)
+1421ms ║║Cancelling condition
#23’s schedules…
+1422ms ║║Condition
#23 evaluated false (7ms)
+1423ms ║║Cancelling condition
#21’s schedules…
+1424ms ║║Condition group
#21 evaluated false (state changed) (21ms)
+1444ms ║║Comparison (date) 1569556800000 is_equal_to (date) 1569556800000 = true (3ms)
+1446ms ║║Condition
#22 evaluated true (10ms)
+1451ms ║║Comparison (dynamic) candles is_equal_to (string) candles = true (1ms)
+1453ms ║║Cancelling condition
#23’s schedules…
+1454ms ║║Condition
#23 evaluated true (7ms)
+1455ms ║║Cancelling condition
#21’s schedules…
+1456ms ║║Condition group
#21 evaluated true (state changed) (21ms)
+1459ms ║║Cancelling statement
#24’s schedules…
+1470ms ║║Calculating (string) candle lighting today is at + (string) 6:49 PM >> (string) candle lighting today is at 6:49 PM
+1474ms ║║candle lighting today is at 6:49 PM
+1475ms ║║Executed virtual command log (1ms)
+1498ms ║║Comparison (date) 1569556800000 is_equal_to (date) 1569556800000 = true (2ms)
+1499ms ║║Condition
#22 evaluated true (10ms)
+1506ms ║║Comparison (dynamic) havdalah is_equal_to (string) candles = false (2ms)
+1507ms ║║Cancelling condition
#23’s schedules…
+1508ms ║║Condition
#23 evaluated false (8ms)
+1510ms ║║Cancelling condition
#21’s schedules…
+1511ms ║║Condition group
#21 evaluated false (state changed) (21ms)
+1531ms ║║Comparison (date) 1569556800000 is_equal_to (date) 1569556800000 = true (3ms)
+1533ms ║║Condition
#22 evaluated true (10ms)
+1539ms ║║Comparison (dynamic) candles is_equal_to (string) candles = true (1ms)
+1540ms ║║Cancelling condition
#23’s schedules…
+1542ms ║║Condition
#23 evaluated true (7ms)
+1543ms ║║Cancelling condition
#21’s schedules…
+1544ms ║║Condition group
#21 evaluated true (state changed) (22ms)
+1546ms ║║Cancelling statement
#24’s schedules…
+1557ms ║║Calculating (string) candle lighting today is at + (string) 6:38 PM >> (string) candle lighting today is at 6:38 PM
+1562ms ║║candle lighting today is at 6:38 PM
+1563ms ║║Executed virtual command log (2ms)
+1584ms ║║Comparison (date) 1569556800000 is_equal_to (date) 1569556800000 = true (2ms)
+1586ms ║║Condition
#22 evaluated true (10ms)
+1591ms ║║Comparison (dynamic) havdalah is_equal_to (string) candles = false (1ms)
+1593ms ║║Cancelling condition
#23’s schedules…
+1594ms ║║Condition
#23 evaluated false (8ms)
+1595ms ║║Cancelling condition
#21’s schedules…
+1596ms ║║Condition group
#21 evaluated false (state changed) (21ms)
+1617ms ║║Comparison (date) 1569556800000 is_equal_to (date) 1569556800000 = true (3ms)
+1619ms ║║Condition
#22 evaluated true (10ms)
+1625ms ║║Comparison (dynamic) candles is_equal_to (string) candles = true (1ms)
+1626ms ║║Cancelling condition
#23’s schedules…
+1627ms ║║Condition
#23 evaluated true (7ms)
+1628ms ║║Cancelling condition
#21’s schedules…
+1629ms ║║Condition group
#21 evaluated true (state changed) (21ms)
+1632ms ║║Cancelling statement
#24’s schedules…
+1643ms ║║Calculating (string) candle lighting today is at + (string) 6:26 PM >> (string) candle lighting today is at 6:26 PM
+1646ms ║║candle lighting today is at 6:26 PM
+1648ms ║║Executed virtual command log (1ms)
+1668ms ║║Comparison (date) 1569556800000 is_equal_to (date) 1569556800000 = true (2ms)
+1670ms ║║Condition
#22 evaluated true (10ms)
+1676ms ║║Comparison (dynamic) havdalah is_equal_to (string) candles = false (1ms)
+1677ms ║║Cancelling condition
#23’s schedules…
+1678ms ║║Condition
#23 evaluated false (7ms)
+1680ms ║║Cancelling condition
#21’s schedules…
+1681ms ║║Condition group
#21 evaluated false (state changed) (21ms)
+1701ms ║║Comparison (date) 1569556800000 is_equal_to (date) 1569556800000 = true (2ms)
+1703ms ║║Condition
#22 evaluated true (10ms)
+1708ms ║║Comparison (dynamic) holiday is_equal_to (string) candles = false (1ms)
+1710ms ║║Condition
#23 evaluated false (6ms)
+1711ms ║║Condition group
#21 evaluated false (state did not change) (19ms)
+1732ms ║║Comparison (date) 1569556800000 is_equal_to (date) 1569556800000 = true (2ms)
+1733ms ║║Condition
#22 evaluated true (10ms)
+1739ms ║║Comparison (dynamic) candles is_equal_to (string) candles = true (1ms)
+1741ms ║║Cancelling condition
#23’s schedules…
+1742ms ║║Condition
#23 evaluated true (8ms)
+1743ms ║║Cancelling condition
#21’s schedules…
+1744ms ║║Condition group
#21 evaluated true (state changed) (21ms)
+1746ms ║║Cancelling statement
#24’s schedules…
+1757ms ║║Calculating (string) candle lighting today is at + (string) 6:22 PM >> (string) candle lighting today is at 6:22 PM
+1761ms ║║candle lighting today is at 6:22 PM
+1762ms ║║Executed virtual command log (2ms)
+1784ms ║║Comparison (date) 1569556800000 is_equal_to (date) 1569556800000 = true (3ms)
+1786ms ║║Condition
#22 evaluated true (11ms)
+1792ms ║║Comparison (dynamic) holiday is_equal_to (string) candles = false (1ms)
+1793ms ║║Cancelling condition
#23’s schedules…
+1795ms ║║Condition
#23 evaluated false (7ms)
+1796ms ║║Cancelling condition
#21’s schedules…
+1797ms ║║Condition group
#21 evaluated false (state changed) (21ms)
+1817ms ║║Comparison (date) 1569556800000 is_equal_to (date) 1569556800000 = true (2ms)
+1819ms ║║Condition
#22 evaluated true (10ms)
+1825ms ║║Comparison (dynamic) candles is_equal_to (string) candles = true (1ms)
+1827ms ║║Cancelling condition
#23’s schedules…
+1828ms ║║Condition
#23 evaluated true (8ms)
+1829ms ║║Cancelling condition
#21’s schedules…
+1830ms ║║Condition group
#21 evaluated true (state changed) (22ms)
+1833ms ║║Cancelling statement
#24’s schedules…
+1844ms ║║Calculating (string) candle lighting today is at + (string) 7:51 PM >> (string) candle lighting today is at 7:51 PM
+1848ms ║║candle lighting today is at 7:51 PM
+1849ms ║║Executed virtual command log (2ms)
+1871ms ║║Comparison (date) 1569556800000 is_equal_to (date) 1569556800000 = true (2ms)
+1873ms ║║Condition
#22 evaluated true (11ms)
+1879ms ║║Comparison (dynamic) is_equal_to (string) candles = false (2ms)
+1881ms ║║Cancelling condition
#23’s schedules…
+1882ms ║║Condition
#23 evaluated false (7ms)
+1883ms ║║Cancelling condition
#21’s schedules…
+1884ms ║║Condition group
#21 evaluated false (state changed) (23ms)
+1886ms ║╚Execution stage complete. (1701ms)
+1888ms ╚Event processed successfully (1888ms)