Owntracks / Mosquitto String updates unexepectedly.
-
toggledbitswrote on Dec 14, 2022, 2:52 PM last edited by toggledbits Dec 14, 2022, 9:54 AM
@therealdb Also know that I'm changing the behavior of the
isNaN()
function to return true when the argument isnull
. This is a break from JavaScript's behavior, but I find that behavior strange and inconsistent. In my mind, ifparseFloat()
andparseInt()
returnNaN
fornull
, then so shouldisNaN()
. Do you agree?Edit: FYI, I plan on a released build in the next day or two.
-
@toggledbits yes, OK for me. so, no actions on my part?
-
toggledbitswrote on Dec 14, 2022, 5:05 PM last edited by toggledbits Dec 14, 2022, 12:05 PM
No, that will make it work the way expected (and I would have done the same). No change from you needed.
-
Morning. Updated reactor and mqtt controller this morning (hope I did it right)
Mrs C left home and this happened:
Her owntrack_sensor:
battery_maintenance.charging=false battery_maintenance.rechargeable=null battery_maintenance.replace=false battery_power.level=0.5 battery_power.since=null binary_sensor.state=true location.elevation=null location.latitude=null location.longitude=null string_sensor.value=null x_mqtt_device.online=true
[latest-22349]2022-12-17T08:05:51.851Z <httpapi:INFO> httpapi: API request from ::ffff:192.168.70.253: GET /api/v1/systime [latest-22349]2022-12-17T08:08:06.840Z <httpapi:INFO> httpapi: API request from ::ffff:192.168.70.70: GET /api/v1/systime [latest-22349]2022-12-17T08:11:53.693Z <httpapi:INFO> httpapi: API request from ::ffff:192.168.70.253: GET /api/v1/systime [latest-22349]2022-12-17T08:12:00.004Z <Rule:INFO> Garden lights on when the doors are open (rule-lb2h69nb in Outside Lights) starting evaluation; because timer-trigger Timer#rule-lb2h69nb [latest-22349]2022-12-17T08:12:00.007Z <Rule:INFO> Garden lights on when the doors are open (rule-lb2h69nb in Outside Lights) trigger evaluation result is false (previously false) [latest-22349]2022-12-17T08:12:00.008Z <Rule:INFO> Garden lights on when the doors are open (rule-lb2h69nb in Outside Lights) evaluated; trigger state unchanged (false); rule state remains RESET [latest-22349]2022-12-17T08:12:00.009Z <Rule:INFO> Garden lights on when the doors are open (rule-lb2h69nb in Outside Lights) evaluation complete [latest-22349]2022-12-17T08:13:18.980Z <MQTTController:WARN> MQTTController#mqqt if_expr expression payload._type == 'location' || payload._type='transition' returned non-boolean (string) [latest-22349]2022-12-17T08:13:18.987Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) starting evaluation; because entity-changed BinarySensor#mqqt>rachel_owntracks [latest-22349]2022-12-17T08:13:18.987Z <Rule:INFO> Rachel is at the office (rule-lb6bcyk5 in Home or Away) starting evaluation; because entity-changed BinarySensor#mqqt>rachel_owntracks [latest-22349]2022-12-17T08:13:18.991Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) trigger evaluation result is true (previously false) [latest-22349]2022-12-17T08:13:18.991Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) evaluated; rule state transition from RESET to SET! [latest-22349]2022-12-17T08:13:19.001Z <Rule:INFO> Rachel is at the office (rule-lb6bcyk5 in Home or Away) trigger evaluation result is false (previously false) [latest-22349]2022-12-17T08:13:19.001Z <Rule:INFO> Rachel is at the office (rule-lb6bcyk5 in Home or Away) evaluated; trigger state unchanged (false); rule state remains RESET [latest-22349]2022-12-17T08:13:19.002Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) evaluation complete [latest-22349]2022-12-17T08:13:19.002Z <Rule:INFO> Rachel is at the office (rule-lb6bcyk5 in Home or Away) evaluation complete [latest-22349]2022-12-17T08:13:19.003Z <Engine:INFO> Enqueueing "Location Test<SET>" (rule-lbl1mbdn:S) [latest-22349]2022-12-17T08:13:19.004Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) starting evaluation; because timer-trigger Timer#rule-lbl1mbdn [latest-22349]2022-12-17T08:13:19.005Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) trigger evaluation result is false (previously true) [latest-22349]2022-12-17T08:13:19.005Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) evaluated; rule state transition from SET to RESET! [latest-22349]2022-12-17T08:13:19.012Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) evaluation complete [latest-22349]2022-12-17T08:13:19.015Z <Engine:NOTICE> Starting reaction Location Test<SET> (rule-lbl1mbdn:S) [latest-22349]2022-12-17T08:13:19.018Z <Notifier:null> Module Notifier v22283 [latest-22349]2022-12-17T08:13:19.021Z <Engine:INFO> Location Test<SET> all actions completed.
And then this:
[latest-22349]2022-12-17T08:15:00.036Z <Rule:INFO> Morning Heating (rule-l60fkpo3 in Heating Control) evaluation complete [latest-22349]2022-12-17T08:16:53.727Z <httpapi:INFO> httpapi: API request from ::ffff:192.168.70.253: GET /api/v1/systime [latest-22349]2022-12-17T08:19:07.154Z <httpapi:INFO> httpapi: API request from ::ffff:192.168.70.70: GET /api/v1/systime [latest-22349]2022-12-17T08:22:53.684Z <httpapi:INFO> httpapi: API request from ::ffff:192.168.70.253: GET /api/v1/systime [latest-22349]2022-12-17T08:23:07.941Z <MQTTController:ERR> MQTTController#mqqt expression ( payload.event == 'leave' && lower(payload.data.description) != lower(homeRegionName) ) || ( payload.event == 'enter' && lower(payload.data.description) == lower(homeRegionName) ) failed evaluation: [ReferenceError] Invalid scope in reference to member description of (object)null [-] [latest-22349]2022-12-17T08:23:07.944Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) starting evaluation; because entity-changed BinarySensor#mqqt>rachel_owntracks [latest-22349]2022-12-17T08:23:07.944Z <Rule:INFO> Rachel is at the office (rule-lb6bcyk5 in Home or Away) starting evaluation; because entity-changed BinarySensor#mqqt>rachel_owntracks [latest-22349]2022-12-17T08:23:07.945Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) trigger evaluation result is false (previously false) [latest-22349]2022-12-17T08:23:07.945Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) evaluated; trigger state unchanged (false); rule state remains RESET [latest-22349]2022-12-17T08:23:07.945Z <Rule:INFO> Rachel is at the office (rule-lb6bcyk5 in Home or Away) trigger evaluation result is false (previously false) [latest-22349]2022-12-17T08:23:07.946Z <Rule:INFO> Rachel is at the office (rule-lb6bcyk5 in Home or Away) evaluated; trigger state unchanged (false); rule state remains RESET [latest-22349]2022-12-17T08:23:07.946Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) evaluation complete [latest-22349]2022-12-17T08:23:07.947Z <Rule:INFO> Rachel is at the office (rule-lb6bcyk5 in Home or Away) evaluation complet
Have I done something dumb?
CheersC
Also got a lot of these: -
therealdbreplied to CatmanV2 on Dec 17, 2022, 9:04 AM last edited by therealdb Dec 17, 2022, 4:07 AM
@CatmanV2 nope, it's probably something on my end. But I need your mqtt messages, since I'm using it via HTTP-to-MQTT and messages are slightly different. I'll fix it as soon as I'll get yours. Thanks.
EDIT: just look for the message sent in the /event topic.
-
-
Of course it's not happening now!
C
-
@CatmanV2 I have a new version anyway, that's trying to handle null values.
@toggledbits is it possible for MQTTController to dump the payload in case of errors? this will help a lot when dealing with such situations. Thanks. -
@therealdb said in Owntracks / Mosquitto String updates unexepectedly.:
@toggledbits is it possible for MQTTController to dump the payload in case of errors? this will help a lot when dealing with such situations. Thanks.
Heh! I just added that! Clearly we both see the value. 22350 will do that if payload JSON parsing fails, and always log the payload at log level 5. The next release will do it as part of the error logged when/if the
if_expr
orexpr
for an attribute fail evaluation. -
-
-
@realdb
Per PM[latest-22349]2022-12-20T20:10:45.235Z <httpapi:INFO> httpapi: API request from ::ffff:192.168.70.70: GET /api/v1/systime [latest-22349]2022-12-20T20:11:40.948Z <MQTTController:WARN> MQTTController#mqqt if_expr expression payload._type == 'location' || payload._type='transition' returned non-boolean (string) [latest-22349]2022-12-20T20:11:40.952Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) starting evaluation; because entity-changed BinarySensor#mqqt>rachel_owntracks [latest-22349]2022-12-20T20:11:40.952Z <Rule:INFO> Rachel is at the office (rule-lb6bcyk5 in Home or Away) starting evaluation; because entity-changed BinarySensor#mqqt>rachel_owntracks [latest-22349]2022-12-20T20:11:40.954Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) trigger evaluation result is true (previously false) [latest-22349]2022-12-20T20:11:40.954Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) evaluated; rule state transition from RESET to SET! [latest-22349]2022-12-20T20:11:40.961Z <Rule:INFO> Rachel is at the office (rule-lb6bcyk5 in Home or Away) trigger evaluation result is false (previously false) [latest-22349]2022-12-20T20:11:40.961Z <Rule:INFO> Rachel is at the office (rule-lb6bcyk5 in Home or Away) evaluated; trigger state unchanged (false); rule state remains RESET [latest-22349]2022-12-20T20:11:40.961Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) evaluation complete [latest-22349]2022-12-20T20:11:40.961Z <Rule:INFO> Rachel is at the office (rule-lb6bcyk5 in Home or Away) evaluation complete [latest-22349]2022-12-20T20:11:40.962Z <Engine:INFO> Enqueueing "Location Test<SET>" (rule-lbl1mbdn:S) [latest-22349]2022-12-20T20:11:40.963Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) starting evaluation; because timer-trigger Timer#rule-lbl1mbdn [latest-22349]2022-12-20T20:11:40.963Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) trigger evaluation result is false (previously true) [latest-22349]2022-12-20T20:11:40.963Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) evaluated; rule state transition from SET to RESET! [latest-22349]2022-12-20T20:11:40.968Z <Rule:INFO> Location Test (rule-lbl1mbdn in Home or Away) evaluation complete [latest-22349]2022-12-20T20:11:40.973Z <Engine:NOTICE> Starting reaction Location Test<SET> (rule-lbl1mbdn:S) [latest-22349]2022-12-20T20:11:40.980Z <Engine:INFO> Location Test<SET> all actions completed. [latest-22349]2022-12-20T20:14:41.149Z <httpapi:INFO> httpapi: API request from ::ffff:192.168.70.253: GET /api/v1/systime
Cheers
C
-
@CatmanV2 said in Owntracks / Mosquitto String updates unexepectedly.:
@realdb
Per PMv 22352 is on GitHub. It was a stupid mistake on my part that should be fixed. I owe you an apology if this caused some messy reactions, and I thank you for being my tester
-
@therealdb Dude you owe me nothing
C
20/24