• Categories
  • Recent
  • Tags
  • Popular
  • Unsolved
Collapse
Discussion Forum to share and further the development of home control and automation, independent of platforms.

SmartHome Community

OWM error
wmarcolinW

Hi @toggledbits

I'm trying to use OWM, apparently, I receive the correct information, but after a while, the MSR disconnects.

My configuration is as follows.

- id: weather enabled: true implementation: OWMWeatherController name: OWM Weather config: # Place your OWM API key here (remember to enable the controller after adding your appid) appid: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # How often weather is allowed to be refreshed. This helps limit OWN API use, # to keep you in their good graces (and on their free tier). This value is # in minutes. interval: 30 locations: - id: home name: Home Weather # Set the location by specifying ONE OF: latitude+longitude, OWN city # ID, or location (as postal,country). If none is set, the system # location will be used. latitude: 8.9936 longitude: -79.5197 city_id: 3703443 #location: "30269,us" # Enable "save_full_response" to save the full response (you may have # need to use parts of the response that are not part of the wx # capability in your dashboard widgets). #save_full_response: false

When I request a systemctl status reactor I get this message:

root@main:/home/wilson/reactor/logs# systemctl status reactor ● reactor.service - Multi System Reactor Loaded: loaded (/etc/systemd/system/reactor.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2023-09-08 21:03:13 EST; 5s ago Main PID: 194711 (node) Tasks: 11 (limit: 9390) Memory: 82.5M CPU: 2.508s CGroup: /system.slice/reactor.service └─194711 /usr/bin/node app -p Sep 08 21:03:13 main node[194711]: Error: Incompatible serialization data; can't unserialize Sep 08 21:03:13 main node[194711]: at System.unserialize (/home/wilson/reactor/server/lib/Entity.js:624:19) Sep 08 21:03:13 main node[194711]: at /home/wilson/reactor/server/lib/Controller.js:458:70 Sep 08 21:03:13 main node[194711]: at Array.forEach (<anonymous>) Sep 08 21:03:13 main node[194711]: at OWMWeatherController._restoreEntities (/home/wilson/reactor/server/lib/Controller.js:446:36) Sep 08 21:03:13 main node[194711]: at new Controller (/home/wilson/reactor/server/lib/Controller.js:37:45) Sep 08 21:03:13 main node[194711]: at new OWMWeatherController (/home/wilson/reactor/server/lib/OWMWeatherController.js:327:9) Sep 08 21:03:13 main node[194711]: at /home/wilson/reactor/server/lib/Controller.js:93:37 Sep 08 21:03:13 main node[194711]: [latest-23242]2023-09-09T02:03:13.855Z <NUTController:null> Module NUTController v22305 Sep 08 21:03:13 main node[194711]: [latest-23242]2023-09-09T02:03:13.859Z <SystemController:null> Module SystemController v23214 root@main:/home/wilson/reactor/logs# root@main:/home/wilson/reactor# systemctl status reactor ● reactor.service - Multi System Reactor Loaded: loaded (/etc/systemd/system/reactor.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2023-09-08 20:48:36 EST; 2min 58s ago Main PID: 194353 (node) Tasks: 11 (limit: 9390) Memory: 66.0M CPU: 9.493s CGroup: /system.slice/reactor.service └─194353 /usr/bin/node app -p Sep 08 20:48:37 main node[194353]: at System.unserialize (/home/wilson/reactor/server/lib/Entity.js:624:19) Sep 08 20:48:37 main node[194353]: at /home/wilson/reactor/server/lib/Controller.js:458:70 Sep 08 20:48:37 main node[194353]: at Array.forEach (<anonymous>) Sep 08 20:48:37 main node[194353]: at OWMWeatherController._restoreEntities (/home/wilson/reactor/server/lib/Controller.js:446:36) Sep 08 20:48:37 main node[194353]: at new Controller (/home/wilson/reactor/server/lib/Controller.js:37:45) Sep 08 20:48:37 main node[194353]: at new OWMWeatherController (/home/wilson/reactor/server/lib/OWMWeatherController.js:327:9) Sep 08 20:48:37 main node[194353]: at /home/wilson/reactor/server/lib/Controller.js:93:37 Sep 08 20:48:37 main node[194353]: [latest-23242]2023-09-09T01:48:37.017Z <NUTController:null> Module NUTController v22305 Sep 08 20:48:37 main node[194353]: [latest-23242]2023-09-09T01:48:37.024Z <SystemController:null> Module SystemController v23214 Sep 08 20:48:37 main node[194353]: [latest-23242]2023-09-09T01:48:37.475Z <Timer:null> Timer#rule-l7ujwva5 just a note: I'm setting a delay of > lines 1-20/20 (END)

I can see this information in the log, but I don't understand what I should do to fix it.

[latest-23242]2023-09-09T02:03:13.838Z <DynamicGroupController:null> Module DynamicGroupController v22313 [latest-23242]2023-09-09T02:03:13.845Z <Structure:INFO> Structure#1 loading controller interface weather (OWMWeatherController) [latest-23242]2023-09-09T02:03:13.847Z <OWMWeatherController:null> Module OWMWeatherController v22294 [latest-23242]2023-09-09T02:03:13.850Z <Controller:WARN> OWMWeatherController#weather failed (1) to restore entity controller_all: [Error] Inco> [latest-23242]2023-09-09T02:03:13.850Z <Controller:CRIT> Error: Incompatible serialization data; can't unserialize [-] Error: Incompatible serialization data; can't unserialize at Group.unserialize (/home/wilson/reactor/server/lib/Entity.js:624:19) at /home/wilson/reactor/server/lib/Controller.js:458:70 at Array.forEach (<anonymous>) at OWMWeatherController._restoreEntities (/home/wilson/reactor/server/lib/Controller.js:446:36) at new Controller (/home/wilson/reactor/server/lib/Controller.js:37:45) at new OWMWeatherController (/home/wilson/reactor/server/lib/OWMWeatherController.js:327:9) at /home/wilson/reactor/server/lib/Controller.js:93:37 [latest-23242]2023-09-09T02:03:13.851Z <Controller:WARN> OWMWeatherController#weather failed (1) to restore entity default: [Error] Incompatibl> [latest-23242]2023-09-09T02:03:13.851Z <Controller:CRIT> Error: Incompatible serialization data; can't unserialize [-] Error: Incompatible serialization data; can't unserialize at Entity.unserialize (/home/wilson/reactor/server/lib/Entity.js:624:19) at /home/wilson/reactor/server/lib/Controller.js:458:70 at Array.forEach (<anonymous>) at OWMWeatherController._restoreEntities (/home/wilson/reactor/server/lib/Controller.js:446:36) at new Controller (/home/wilson/reactor/server/lib/Controller.js:37:45) at new OWMWeatherController (/home/wilson/reactor/server/lib/OWMWeatherController.js:327:9) at /home/wilson/reactor/server/lib/Controller.js:93:37 [latest-23242]2023-09-09T02:03:13.852Z <Controller:WARN> OWMWeatherController#weather failed (1) to restore entity system: [Error] Incompatible> [latest-23242]2023-09-09T02:03:13.852Z <Controller:CRIT> Error: Incompatible serialization data; can't unserialize [-] Error: Incompatible serialization data; can't unserialize at System.unserialize (/home/wilson/reactor/server/lib/Entity.js:624:19) at /home/wilson/reactor/server/lib/Controller.js:458:70 at Array.forEach (<anonymous>) at OWMWeatherController._restoreEntities (/home/wilson/reactor/server/lib/Controller.js:446:36) at new Controller (/home/wilson/reactor/server/lib/Controller.js:37:45) at new OWMWeatherController (/home/wilson/reactor/server/lib/OWMWeatherController.js:327:9) at /home/wilson/reactor/server/lib/Controller.js:93:37 [latest-23242]2023-09-09T02:03:13.853Z <Structure:INFO> Structure#1 loading controller interface nut (NUTController) [latest-23242]2023-09-09T02:03:13.855Z <NUTController:null> Module NUTController v22305 [latest-23242]2023-09-09T02:03:13.855Z <Controller:INFO> Loaded NUTController version "0.1.22305"; Patrick Rigney/Kedron Holdings LLC <patrick@> [latest-23242]2023-09-09T02:03:13.857Z <Structure:INFO> Structure#1 loading controller interface reactor_system (SystemController) [

And finally, I have a second house, with the same OWM configuration I made today, and it doesn't show any errors.

Please, your traditional help.

Thanks.

Multi-System Reactor
Host time is wrong
wmarcolinW

@toggledbits

After a prolonged power cut, the UPS was unable to cope with the weather and shut down the entire system.

When I returned, I had the problem that the host time displayed in the browser and automatically used in the rules was not correct.

I searched for a topic here on this forum that talked about it, but it referred to a container installation. There was a recommendation to go into the storage/states directory and delete the files and restart MSR, I did it and it didn't solve the problem.

There was also a recommendation to go directly to the browser to check the time, and I did so and I see that the time is correct.

8ad429c8-ea5f-45b4-8670-7d0353a50a0e-image.png

As you can see on the screen above:

MSR browser shows the correct browser time 21:23, but host time 13:02; In the browser below the direct query and the host time is correct 9:22:54 PM; Setting the VM date command on the third screen, the time is 9:23:00 PM.

I've opened the entire reactor.log file and searched for any errors, and there aren't any.

^L [latest-23242]2023-09-15T02:11:12.928Z <app:null> Reactor build latest-23242-5ee8e1d4 starting on v18.12.0 [latest-23242]2023-09-15T02:11:12.929Z <app:null> Process ID 1807 user/group 1000/1000; bare-metal; platform linux/x64 #179-Ubuntu SMP Mo> [latest-23242]2023-09-15T02:11:12.929Z <app:null> Basedir /home/leonardo/reactor; data in /home/leonardo/reactor/storage [latest-23242]2023-09-15T02:11:12.929Z <app:null> NODE_PATH=/home/leonardo/reactor [latest-23242]2023-09-15T02:11:12.933Z <app:INFO> Configured locale (undefined); selected locale(s) en_US.UTF-8 [latest-23242]2023-09-15T02:11:12.955Z <app:INFO> Loaded locale en-US for en-US [latest-23242]2023-09-15T02:11:12.958Z <Structure:null> Module Structure v23172 [latest-23242]2023-09-15T02:11:12.959Z <Capabilities:null> Module Capabilities v22356 [latest-23242]2023-09-15T02:11:12.969Z <Capabilities:NOTICE> System capabilities loaded from core distribution, data version 23914 revisi> [latest-23242]2023-09-15T02:11:12.978Z <Plugin:null> Module Plugin v22300 [latest-23242]2023-09-15T02:11:12.981Z <TimerBroker:null> Module TimerBroker v22283 [latest-23242]2023-09-15T02:11:12.983Z <Entity:null> Module Entity v22353 [latest-23242]2023-09-15T02:11:12.986Z <Controller:null> Module Controller v23069 [latest-23242]2023-09-15T02:11:12.992Z <default:null> Module Ruleset v22293 [latest-23242]2023-09-15T02:11:12.992Z <default:null> Module Rulesets v22146 [latest-23242]2023-09-15T02:11:12.996Z <GlobalExpression:null> Module GlobalExpression v23211 [latest-23242]2023-09-15T02:11:13.003Z <Predicate:null> Module Predicate v23093 [latest-23242]2023-09-15T02:11:13.005Z <AlertManager:null> Module AlertManager v22283 [latest-23242]2023-09-15T02:11:13.007Z <Rule:null> Module Rule v23107 [latest-23242]2023-09-15T02:11:13.009Z <GlobalReaction:null> Module GlobalReaction v22324 [latest-23242]2023-09-15T02:11:13.010Z <Engine:null> Module Engine v23231 [latest-23242]2023-09-15T02:11:13.012Z <httpapi:null> Module httpapi v23058 [latest-23242]2023-09-15T02:11:13.019Z <wsapi:null> Module wsapi v23172 [latest-23242]2023-09-15T02:11:13.019Z <app:NOTICE> Starting Structure...

As you can see, the time in the log is 02:11, which is correct, because I'm in time zone -5, which means it's 09:11PM for me.

I've restarted the VM, the computer hosting the VM, and the MSR a few times and the same difference remains. What do you recommend for the next step in understanding and solving the problem?

Thanks.

Multi-System Reactor
[SOLVED-ish] New iblind and zwaveJScontroller/MSR not communicating
G

I installed a new iblind this evening and it is appearing in ZWaveJS. It is operational thru Home Assistant just fine. It is operational thru the HA ZwaveJS plugin just fine.

Where it is non-responsive is in MSR for some reason. The entities are there. Adding the node to a Reaction and then attempting to run said Reaction nets me this:

[latest-23242]2023-09-08T05:33:08.454Z <ZWaveJSController:5:ZWaveJSController.js:655> ZWaveJSController#zwavejs _apply_value motion_sensor.state=false [latest-23242]2023-09-08T05:33:08.455Z <ZWaveJSController:5:ZWaveJSController.js:722> ZWaveJSController#zwavejs setting Binary Sensor#zwavejs>11-0.x_zwave_values.Binary_Sensor_Motion to false [latest-23242]2023-09-08T05:33:08.692Z <ZWaveJSController:5:ZWaveJSController.js:360> ZWaveJSController#zwavejs handling node event statistics updated entity Binary Sensor#zwavejs>11-0 [latest-23242]2023-09-08T05:40:23.960Z <ZWaveJSController:INFO> ZWaveJSController#zwavejs performing cover.open on Cover#zwavejs>20-0 with [Object]{ } [latest-23242]2023-09-08T05:40:23.962Z <ZWaveJSController:5:ZWaveJSController.js:1843> ZWaveJSController#zwavejs no implementation mapped; attempting default [latest-23242]2023-09-08T05:40:25.062Z <ZWaveJSController:INFO> ZWaveJSController#zwavejs performing zwave_device.refresh on Cover#zwavejs>20-0 with [Object]{ } **[latest-23242]2023-09-08T05:40:25.063Z <ZWaveJSController:5:ZWaveJSController.js:1843> ZWaveJSController#zwavejs no implementation mapped; attempting default** [latest-23242]2023-09-08T05:40:25.065Z <ZWaveJSController:5:ZWaveJSController.js:294> ZWaveJSController#zwavejs sending #1694151625064<9/8/2023, 1:40:25 AM>: [Object]{ "command": "node.refresh_values", "nodeId": 20, "messageId": 1694151625064 } [latest-23242]2023-09-08T05:40:26.307Z <ZWaveJSController:5:ZWaveJSController.js:360> ZWaveJSController#zwavejs handling node event statistics updated entity Cover#zwavejs>20-0 [latest-23242]2023-09-08T05:40:26.317Z <ZWaveJSController:5:ZWaveJSController.js:360> ZWaveJSController#zwavejs handling node event value updated entity Cover#zwavejs>20-0 [latest-23242]2023-09-08T05:40:26.318Z <ZWaveJSController:5:ZWaveJSController.js:667> ZWaveJSController#zwavejs update node 20 value "0:128:level:" data [Object]{ "source": "node", "event": "value updated", "nodeId": 20, "args": { "commandClassName": "Battery", "commandClass": 128, "property": "level", "endpoint": 0, "newValue": 100, "prevValue": 100, "propertyName": "level" } } [latest-23242]2023-09-08T05:40:26.319Z <ZWaveJSController:5:ZWaveJSController.js:684> ZWaveJSController#zwavejs updating attributes for node 20 value "0:128:level:"=100: [Array][ "battery_power.level", "battery_power.since" ] [latest-23242]2023-09-08T05:40:26.320Z <ZWaveJSController:5:ZWaveJSController.js:698> ZWaveJSController#zwavejs updating attribute battery_power.level with [Object]{ "entity": "20-0", "impl": { "expr": "float( value ) / 100", "valueId": "128:level:" } } [latest-23242]2023-09-08T05:40:26.321Z <ZWaveJSController:5:ZWaveJSController.js:591> ZWaveJSController#zwavejs _apply_value entity Cover#zwavejs>20-0 battery_power.level [latest-23242]2023-09-08T05:40:26.322Z <ZWaveJSController:5:ZWaveJSController.js:655> ZWaveJSController#zwavejs _apply_value battery_power.level=1 [latest-23242]2023-09-08T05:40:26.323Z <ZWaveJSController:5:ZWaveJSController.js:698> ZWaveJSController#zwavejs updating attribute battery_power.since with [Object]{ "entity": "20-0", "impl": { "expr": "time()", "valueId": "128:level:" } } [latest-23242]2023-09-08T05:40:26.323Z <ZWaveJSController:5:ZWaveJSController.js:591> ZWaveJSController#zwavejs _apply_value entity Cover#zwavejs>20-0 battery_power.since [latest-23242]2023-09-08T05:40:26.324Z <ZWaveJSController:5:ZWaveJSController.js:655> ZWaveJSController#zwavejs _apply_value battery_power.since=1694151626324<9/8/2023, 1:40:26 AM> [latest-23242]2023-09-08T05:40:26.325Z <ZWaveJSController:5:ZWaveJSController.js:722> ZWaveJSController#zwavejs setting Cover#zwavejs>20-0.x_zwave_values.Battery_level to 100 [latest-23242]2023-09-08T05:40:26.333Z <ZWaveJSController:5:ZWaveJSController.js:360> ZWaveJSController#zwavejs handling node event value updated entity Cover#zwavejs>20-0 [latest-23242]2023-09-08T05:40:26.334Z <ZWaveJSController:5:ZWaveJSController.js:667> ZWaveJSController#zwavejs update node 20 value "0:128:isLow:" data [Object]{ "source": "node", "event": "value updated", "nodeId": 20, "args": { "commandClassName": "Battery", "commandClass": 128, "property": "isLow", "endpoint": 0, "newValue": false, "prevValue": false, "propertyName": "isLow" } } [latest-23242]2023-09-08T05:40:26.336Z <ZWaveJSController:5:ZWaveJSController.js:324> ZWaveJSController#zwavejs request 1694151625064<9/8/2023, 1:40:25 AM> (node.refresh_values) success notification [latest-23242]2023-09-08T05:40:26.337Z <ZWaveJSController:5:ZWaveJSController.js:684> ZWaveJSController#zwavejs updating attributes for node 20 value "0:128:isLow:"=false: [Array][ ] [latest-23242]2023-09-08T05:40:26.338Z <ZWaveJSController:5:ZWaveJSController.js:722> ZWaveJSController#zwavejs setting Cover#zwavejs>20-0.x_zwave_values.Battery_isLow to false [latest-23242]2023-09-08T05:40:26.558Z <ZWaveJSController:5:ZWaveJSController.js:360> ZWaveJSController#zwavejs handling node event statistics updated entity Cover#zwavejs>20-0

Please note the highlighted logpart - no other iblind has this. In addition, in MSR>Entities several show as null rather than having a value as the others do.

69631fbc-db4e-4e8d-aa98-10565811cd93-image.png

I tried deleting all Entities associated with this device from MSR and then refreshing ZWaveJS in Home Assistant and restarting MSR - the Entities return but in the same state/s.

Admittedly, it's been a very long three weeks at work - I could have missed something obvious during setup but I sure can't figure what it is.

Multi-System Reactor
Reactor (Multi-System/Multi-Hub) Announcements
toggledbitsT

Build 21228 has been released. Docker images available from DockerHub as usual, and bare-metal packages here.

Home Assistant up to version 2021.8.6 supported; the online version of the manual will now state the current supported versions; Fix an error in OWMWeatherController that could cause it to stop updating; Unify the approach to entity filtering on all hub interface classes (controllers); this works for device entities only; it may be extended to other entities later; Improve error detail in messages for EzloController during auth phase; Add isRuleSet() and isRuleEnabled() functions to expressions extensions; Implement set action for lock and passage capabilities (makes them more easily scriptable in some cases); Fix a place in the UI where 24-hour time was not being displayed.
Multi-System Reactor
Migration question
T

Good afternoon,
I'm running my MSR instance on an old NAS server running Fedora 37 Server. This is an older Core i5-4690K server that has served me well overall, but it's showing it's age, and will often reboot into maint mode if it applies updates overnight. I've been trying to troubleshoot, but it's also in my office (makes my office hot), and I'm looking at getting either a QNAP or Syslogy rack mount NAS to replace it.

What I'm wondering is what the process would be to migrate my current MSR config and move it to a different platform. I have quite a large ruleset that I don't want to have to recreate. I know I can run it in a container on either platform, but I'm not sure how I would migrate all my rules over. Is there one config file that has all of the rules, or could I simply copy my /reactor directory over to a enw platform?

I am also considering moving the MSR instance to a stand alone RPI 4 with a SSD. This way, while I'm migrating all of my files off of my NAS, I'm not loosing Reactor's functionality until I have whichever rack mount NAS I go with up and running, with all of the data migrated.

Thoughts?

Multi-System Reactor
docker synology import
M

Hello,

I've installed MSR in a Docker container on my Synology NAS. I'm able to access my Vera, but I'm having trouble using the Reactor import within the Docker environment. I'm using the Docker terminal, and I've navigated to "/opt/reactor". However, when I try to run the command, it's telling me I'm not in the installation directory, even though I can see the "tools" directory and the "apps.js" file there. I've also tried changing the file permissions, but nothing seems to work. How do you manage this in a Synology Docker container? Do you use the terminal inside Docker, or SSH into the Synology itself? I'm not finding the "/opt/reactor" path, but I see a "/var/reactor" directory, which I placed in my storage folder.

ERROR: This script must only be run from the Reactor app directory.

Multi-System Reactor
MSR - Bug report
T

@toggledbits

Maybe I'm missing something, but this appears to be a bug.

I'm troubleshooting a rule to see if one of the system participants is arriving (presence changes from not home to home). I want this arriving state to be less than 5 minutes (300 seconds), to differentiate between being home for a longer period of time, and just getting home.

In the restrictions sections of the Trigger, I set "Condition must be sustained for less than 300 seconds", and I save the trigger.

After I save and exit, I'm looking at the rule, and it's changed itself to x_hass.state == home; for at least 300 secs. I go back into edit the rule, and it in fact shows "at least" from the drop down.

This logic is of course failing and I can't seem to get it to work.

Changed to less than, and saved:

10a57ff9-4d8c-46b3-b594-399ef2a6d320-image.png

Exited:

a81587d6-f0fa-4518-ad00-a9f601f14509-image.png

Back in rule:

b8e27dd2-e6e7-4f93-844e-83e2b11e976d-image.png

I'm running latest-23218-ebab7a1b.

Multi-System Reactor
MSR Detecting HA Proximity Entity State as a String
PablaP

I added the Proximity integration to HA to create automations based on if a person is on vacation or not. The integration creates an entity and its x_hass.state is the distance to the zone you have setup in HA. For some reason MSR sees that value as a string so I am not able to use the<, >, etc operators as a trigger. Is there anyway this could be fixed without needing to convert the string in a local expression?

MSR 23218
HA 2023.8.3

Entity Attributes if needed

x_hass.domain="proximity" x_hass.entity_id="proximity.arman_proximity" x_hass.services=["proximity"] x_hass.state="0" x_hass_attr.dir_of_travel="unknown" x_hass_attr.friendly_name="arman_proximity" x_hass_attr.nearest="Arman’s iPhone" x_hass_attr.unit_of_measurement="km"
Multi-System Reactor
MSR SMTP Notifications fail - <wsapi:CRIT> Error: Engine has not been started
B

MSR Version: latest-23218
Running as Docker Container : Docker version 24.0.5, build ced0996
OS: Linux 15BPMSR1 6.1.26-05272-g26c406245a2c #1 SMP PREEMPT_DYNAMIC Thu Apr 27 10:15:40 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

SMTP notifications had been working fine and I am unsure exactly what action(s) stopped it from working.

I have verified that the SMTP server configured in notifications.yml is working properly.

To duplicate the problem I am forcing an SMTP email notification using the set reaction play button, the reactor.log shows the following errors:

[latest-23218]2023-08-21T14:23:22.462Z <wsapi:ERR> [WSAPI]wsapi#1 can't queue reaction rule-lgxmrba4:S: [Error] Engine has not been started [-] [latest-23218]2023-08-21T14:23:22.463Z <wsapi:CRIT> Error: Engine has not been started [-] Error: Engine has not been started at Engine.queueReaction (/opt/reactor/server/lib/Engine.js:1494:46) at WSAPI.clientMessage (/opt/reactor/server/wsapi/wsapi.js:782:64) at WebSocket.<anonymous> (/opt/reactor/server/wsapi/wsapi.js:301:157) at WebSocket.emit (node:events:527:28) at WebSocket.emit (node:domain:475:12) at Receiver.receiverOnMessage (/opt/reactor/node_modules/ws/lib/websocket.js:1068:20) at Receiver.emit (node:events:527:28) at Receiver.emit (node:domain:475:12) at Receiver.dataMessage (/opt/reactor/node_modules/ws/lib/receiver.js:517:14) at Receiver.getData (/opt/reactor/node_modules/ws/lib/receiver.js:435:17)

I have tried:

OS level: apt udate and apt upgrade and reboot

docker pull toggledbits/reactor:latest-aarch64 latest-aarch64: Pulling from toggledbits/reactor Digest: sha256:d8a019d457c9fef61f7c3e6908db1f1d0a2d14b6f7c5e9d4fc536c791503d152 Status: Image is up to date for toggledbits/reactor:latest-aarch64 docker.io/toggledbits/reactor:latest-aarch64

docker stop reactor
docker start reactor

docker compose down
docker compose up -d

To no avail.

I feel like I'm missing something obvious but can't put my finger on it.

Thank you in advance for any guidance.
-bh

Multi-System Reactor
Long-running task in MSR
therealdbT

I have a rule that's driving my pool heater to match the solar excess. In the previous iteration, I checked for the status every minute, but I wanted something different and smarter. The logic is basically:

run continuously from 9:15 to 18:15 check for conditions, and if there's solar excess, use the power to turn on the heater, then wait 1 minute to check again turn off the heater, then wait 5 minutes to prevent frequent on/off cycles

I thought that this could be very similar to Reactor-Ex machina's logic, so I crafted a rule that's basically doing the same: an infinite loop from 9:15 to 18:15 that's checking for status and has a delay based on the heater's condition.

All went well, but after a couple of hours, I got this:

Reaction task "49683" failed due to an exception. Please see the log. rule-liy7z3gf:S (Pool-Heater-Solar) step 0: Error: Task has run too much! Runaway?

and the rule was reset (and the heater was left on). Is that by design and I should adopt another strategy? What are others doing when they have a state machine?

With the EV charger I did two groups of condition, each triggering every x minutes based on the charger status, but this seems less smarter and very rudimental. Any suggestion is appreciated. Thanks.

Multi-System Reactor
Integrate UPS with MSR
wmarcolinW

I have a Tripp-Lite UPS (https://www.tripplite.com/smartpro-lcd-120v-1500va-900w-line-interactive-ups-avr-tower-lcd-usb-10-outlets~smart1500lcdt) that connected by a USB cable to my computer, reports various power supply and failure information, as shown in the panel below.

b9f0ea34-d654-4b26-b968-4f8cf0a4e0c1-image.png

afa73913-5318-42c6-af9a-02d36e2e6ea1-image.png

The application I installed runs Java and opens the console to send the information.

Has anyone tried to bring the information into the MSR? Or even a VeraPlus?

Thanks.

Multi-System Reactor
pattern match or find expression? I am stuck again
cw-kidC

Hi

I am stuck trying to extract the "SignalLevel" value which is the WIFI Signal Strength off my Foscam via a http request. The request returns this, which isn't Json formatted data I don't think.

<CGI_Result> <result>0</result> <SignalLevel>52</SignalLevel> </CGI_Result>

I created a rule that saves the http response into a Global Expression

872f534e-5899-43e4-ade5-f2b8ab54a412-image.png

But I am struggling to work out what is the correct expression code to extract the value?

Can anyone more knowledgeable please help?

Thank you.

Multi-System Reactor
MSR thinks all my Ezlo Controller devices no longer exist, they do !
cw-kidC

Hi

Today in MSR alerts I see 100 alerts saying that the devices on my Ezlo controllers no longer exist.

They do still exist. I checked some of these devices in the Ezlo Online API Tool doing a hub.devices.list query.

I then checked that the ID numbers were the same for the devices and they are the same device ID's still.

So my devices do still exist with the same device ID's it seems.

So not sure why MSR has over 100 alerts saying otherwise.

9d7c4732-40f3-4551-b8d4-e24e0e8dda10-image.png

I then looked in Entities selected my Ezlo Plus controller and it listed all my devices OK I think and nothing looked out of place.

Thanks

Multi-System Reactor
Is this possible? Store data from Asus Router ajax .asp page for Temperature data.
cw-kidC

I just discovered there is a secret webpage I didn't know about for my Asus Merlin router that when I run it in a browser gives me all the routers current temperatures.

http://192.168.0.1/ajax_coretmp.asp

249c6e47-38ae-4812-b149-da1fd22072cb-image.png

I have to be logged into the router to access it however.

I tried to create an MSR rule with a HTTP request to store all this data in to a local expression.

But it looks like its not passing or accepting the username and password for my router, I tried Basic and Digest.

I just get this back in the local expression in the rule.

(string) "<HTML><HEAD><script>window.top.location.href='/Main_Login.asp';</script>\n</HEAD></HTML>\n"

The data returned in the browser looked like this:

curr_coreTmp_wl0_raw = "43°C"; curr_coreTmp_wl0 = (curr_coreTmp_wl0_raw.indexOf("disabled") > 0 ? 0 : curr_coreTmp_wl0_raw.replace("°C", "")); curr_coreTmp_wl1_raw = "49°C"; curr_coreTmp_wl1 = (curr_coreTmp_wl1_raw.indexOf("disabled") > 0 ? 0 : curr_coreTmp_wl1_raw.replace("°C", "")); curr_coreTmp_wl2_raw = "disabled"; curr_coreTmp_wl2 = (curr_coreTmp_wl2_raw.indexOf("disabled") > 0 ? 0 : curr_coreTmp_wl2_raw.replace("°C", "")); curr_coreTmp_wl3_raw = "disabled"; curr_coreTmp_wl3 = (curr_coreTmp_wl3_raw.indexOf("disabled") > 0 ? 0 : curr_coreTmp_wl3_raw.replace("°C", "")); curr_cpuTemp = "66.495"; fanctrl_info = "";

I know how to do this for webpages and sites that give back JSON data, however this data I am not sure what format it is, Javascript ? The page is a .asp ajax page.

So not sure if this is possible ?

I really wanted to monitor the CPU temps on my router as its been getting very hot, even with extra USB fans now on the back of it. Think its a firmware bug maybe in the Asus firmware as others have been talking about it online.

Thanks.

Multi-System Reactor
Virtual Devices for lamellas in Vera
therealdbT

So, I've just installed two venetian blinds and I want to control their lamellas with Fibaro FGRM222.
According to the old place, this could be accomplished with some Zwave raw messages and I'm OK with it.
Since I've moved (mostly) everything virtual in MSR, I'm now ready to add a virtual device with actions.

Looking at the docs, it seems possible, but it's not documented. @toggledbits any hints? I want to define a cover and send Zwave commands to the existing x_vera_svc_micasaverde_com_ZWaveNetwork1.SendData action. Thanks.

Multi-System Reactor
Feature request: user authentication
T

@toggledbits,
I'm not sure if this is something you've looked into (or something I'm completely missing in the installation documentation), but would it be possible to add user authentication to the MSR frontend? On my Home Assistant instance, I have external access set up using Cloudflare, and I can add other instances within my network to that Cloudflare configuration, but without any sort of authentication to access MSR, I obviously can't open it to the internet, unless I want random people screwing around with my home automation.

Multi-System Reactor
TypeError: Cannot set properties of undefined (setting '__suppress_dependencies') when setting variables
therealdbT

I've just updated to 23218 and now I'm getting this:

27a959bd-486b-41ae-8137-c5f456044a82-image.png

There seems to be related to global variables. The first and last ones are global reactions, while the second is a normal one. All are setting global variables.

Multi-System Reactor
Feature Request: Latest Reactor Version Number Attribute
PablaP

Hey @toggledbits was wondering if we could have the latest reactor version number as an attribute for the Reactor System entity. It would be useful for me so I can use it for my wget command to automatically download the latest .tar.gz file. Ideally the complete version number like this 23171-85463e02.

Multi-System Reactor
Odd behavior in Weekday checkmarks (MSR)
T

@toggledbits ,
I was just taking a look at some of my scheduling to adjust for a new work schedule, and I noticed that the checkboxes for days of the week appear to be off.

75e1b936-1693-4db1-8ed5-ecfae57d3abf-image.png

if you'll notice in the screenshot, Sun - Tuesday are good, but then Sat comes next, then Wed, then Sat again, then Wed again. No TGIF in this week.

I know this isn't how I set up the rules (which would explain the behavior I was investigating).

Edit: BTW, I checked all my Week Day entries, and they are all like this.

I'm running latest-23196-40ef07f4 on Fedora 37 Server w/o Docker.

Multi-System Reactor

Welcome. If you’d like to participate in the discussion, rather than just read, then you can join the forum. As a member, you can interact with others here to share your experience and ask the questions you need answered.

For those who registered but didn't received the confirmation email, please send an email to support@smarthome.community with the email you used

Latest version is installed, we are still working on some visual changes.

Multidimensional Array

Scheduled Pinned Locked Moved Multi-System Reactor
28 Posts 3 Posters 636 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • wmarcolinW Offline
    wmarcolinW Offline
    wmarcolin
    wrote on last edited by
    #1

    Hi @toggledbits it is possible to have an array in the following way

    ["Window 1"]["Status On"]
    ["Window 2"]["Status On"]
    ["Window 3"]["Status Off"]
    ["Window 4"]["Status On"]

    That is, bidirectional.

    How would this array be loaded? Normally we use Variable = ${{ ["Window 1", "Window 2", "Window 3", "Window 4"] }}, how would the array pair be loaded?.

    Then the use, how would be a looping where I want to ask who has "Status On" and it returns me a new array with the part 1, that is the list of "Window"?

    Or another search, I provide the information of the content of part 1, as "Window 2" and it would return me an array with the part 2 "Satus On".

    Is it possible to have something like this?

    Could you give the examples?

    Thanks.

    toggledbitsT 1 Reply Last reply
    0
  • ElcidE Offline
    ElcidE Offline
    Elcid
    wrote on last edited by Elcid
    #2
    ${{[["Window 1","Status On"],["Window 2","Status On"],["Window 3","Status Off"],["Window 4","Status On"]]}}
    

    should work
    and to find all Status on's

    each val in testarray : if val[1] === "Status On" then val[0] endif
    

    and to find the value of Window 1

    (each val in testarray : if val[0] === "Window 1" then val[1] endif)[0]
    
    wmarcolinW 1 Reply Last reply
    0
  • wmarcolinW Offline
    wmarcolinW Offline
    wmarcolin
    replied to Elcid on last edited by
    #3

    @elcid SUPER!!! Thanks a lot!!

    1 Reply Last reply
    0
  • wmarcolinW Offline
    wmarcolinW Offline
    wmarcolin
    wrote on last edited by
    #4

    @Elcid

    Expanding the question, suppose the first part of the array is the device ID, like "vera>device1234".

    Is it possible to use the function below to use this same bidirectional array to search for the name, i.e. using val[0] for the search?

    sort( each id in testarray: do e=getEntity( id ), ( e?.attributes?.binary_sensor?.state == true or e?.attributes?.motion_sensor?.state == true ) ? e.name : null done )

    What would the function look like?

    Thanks.

    1 Reply Last reply
    0
  • toggledbitsT Offline
    toggledbitsT Offline
    toggledbits
    replied to wmarcolin on last edited by toggledbits
    #5

    @wmarcolin I smell an X-Y problem, but I'll go on...

    I don't know what "bidirectionally" means in this context. Do you mean "two dimensional?" Bidirectional refers to movement, for example, forwards and backwards, or up and down, which is a different thing.

    A couple of minor comments to @Elcid 's response:

    ${{[["Window 1","Status On"],["Window 2","Status On"],["Window 3","Status Off"],["Window 4","Status On"]]}}

    Note that this is substitution syntax, not expression syntax when defining a variable. Adjust accordingly.

    each val in testarray : if val[1] === "Status On" then val[0] endif

    There is no === operator in the expression language, it's just ==

    (each val in testarray : if val[0] === "Window 1" then val[1] endif)[0]

    This is better written as first ... of ..., since you only want the one element (which by implication here the key "Window 1" must be unique in the array), and there's no need to keep searching through the array once you've found it (wastes CPU cycles).

    But about that uniqueness for "Window 1"... this is the real meat of my response:

    If the first element of each subarray (row) is unique, then using a two-dimensional array is inefficient (i.e. doable, but not the best choice). Where unique values are present, an object containing key/value pairs gives immediate random access to any "element", without iteration:

    devices = {
        "lamp1": "on",
        "lamp2": "off",
        "lamp3": "on"
    }
    

    In this example, we can quickly determine the status of any lamp without iteration: devices.lamp2 will give us off.

    This can be further broken down with additional data: each value in the key/value pairs of the object can be any data type, so they can be an array or object themselves:

    devices = {
        "lamp1": {
            "status": "on",
            "room": 0
        }
        "lamp2": { "status": "off", "room": 0 }
        "lamp3": { "status": "on", "room": 2 }
    }
    

    We can again quickly get to the state of lamp2 using devices.lamp2.status (result off again). Using devices.lamp3.room tells us that lamp3 is in room 2. Note that in the example code above, I have shown lamp1 with a typical (JSON-style) fully indented with line breaks for readability, but lamp2 and lamp3 are in a more compact form. Whitespace (including newlines) are not significant to the syntax. Use them for readability if you wish, or leave them out for compactness if that's acceptable.

    When you must search within the values, you can still use iteration. Find the devices in room 0:

        each dev,id in devices: dev.room==0 ? id : null
    

    By using each dev,id, the iterator will provide both the value and the key for each pair in the object. That is, on the first iteration, dev will contain our subobject (itself with keys status and room) for lamp1, and id will contain lamp1; on the second iteration, the subobject for lamp2 is given in dev, and id is lamp2, and so on. The result of the iteration in this case is an array of IDs of objects in room 0: ["lamp1","lamp2"]; you could also modify the iteration to return the data objects (using dev), if that was more efficient for your later use of this expression's result.

    Find the first device that is "off":

        first dev,id of devices: dev.status=="off" ? id : null
    

    Adding new devices after the initialization is also easy:

        devices.lamp4 = { "status": "on", "room": 2 }
    

    But this is all data storage theory, and details of an implementation for a problem that apparently hasn't been stated. We need to know what you are really trying to do, if you are asking for help getting it done. As I said, where we stand right now, this seems very X-Y-ish. The post title is also poor quality, and the head post itself breaks a couple of the posting guidelines.

    Author of Multi-system Reactor and Reactor, DelayLight, Switchboard, and about a dozen other plugins that run on Vera and openLuup.

    wmarcolinW ElcidE 2 Replies Last reply
    0
  • wmarcolinW Offline
    wmarcolinW Offline
    wmarcolin
    replied to toggledbits on last edited by wmarcolin
    #6

    @toggledbits

    Hi Patrick!

    %(#ff0000)[Again a Master Class on how to do the right things.]

    My use case is that I want to associate each device in my installation with an identification of which group it belongs to (door, window, security, light...).

    The group I will have to make the manual list (I think), so the first step of var1, I understand is the list I have to assemble, and whenever I have a new device, I update this list manually.

    386f4215-433c-4e29-81ea-159c7fca255a-image.png

    Just a note master, at the beginning of your example, I had to put the comma at each element of the array

    I reproduced your examples to test, and I just can't find the error in the example of the first (var4).

    b42bc82d-2277-419e-ac93-a5ad94058b84-image.png

    Now comes the use, to see device names and which group they are in, or even to search the groups. My next step, is to manage when a device has the true state of its sensor, to take actions such as triggering an action/alarm/siren/message according to the group the device is part of.

    7b1bf8f9-184e-4cbd-a7dc-34ffb1b61ab1-image.png

    If you can see, I am looking to work around not using (yet) a database, which we have had in other trackers to empower the information from the devices.

    Now exploring the Master, sorry 😁

    In your last example, you explain how to add one more row to the array, one more element, perfect. Now, is it possible to add another column to the existing array? For example, with the array I created, add a column that already stores the device name? A loop that looks at the devid and then looks at the device name attribute?

    I was forgetting, how do I change the contents of the array, is it possible with Set Variable? I want to change for example the group from DevWindow to DevDoor for one element.

    Thanks.

    toggledbitsT 1 Reply Last reply
    0
  • toggledbitsT Offline
    toggledbitsT Offline
    toggledbits
    replied to wmarcolin on last edited by toggledbits
    #7

    @wmarcolin Well, I'm almost ready to release my first version of dynamic groups... still hashing out a few details. If you urgently need to do all this work, it's certainly a good opportunity to break your forehead on some sticky problems (I'm always in favor of experimentation and pushing limits).

    First, having var1 be an expression that does an assignment to devices isn't necessary. Just call your variable devices and put in the rest of the expression after the = in your screen shot and be done with it. You can also set up your devices structure more simply. I'm not sure what the extra dev001 and dev002 identifiers are doing for you, but you can (and probably should) just use the entity canonical IDs directly. It will make everything much simpler. Here's is the expression for the devices variable:

    {
        "hubitat>15": { group: "DevWindow" },
        "vera>device_1866": { group: "DevDoor" },
        ...etc...
    }
    

    Also, if group is the only data you are keeping, there is no value to creating a subobject to keep it, just make the group name be the value of the device's key/ID. But I'll continue with the structure you're trying to use...

    Anyway, by simplifying the structure of devices, here's what it looks like and how it changes your first three expressions:

    340a4917-f984-4a19-9112-39e53f13265e-image.png

    Looking at var2, we need to use quoted identifiers because a canonical ID contains a character (>) that cannot be used in an identifier, so this devices.hubitat>15.group is not valid. The quoted identifier syntax is context["complexKey"] as shown.

    The var3 expression is simpler, because we're not looking through the extra layer of indirection your structure had introduced, we're looking directly as our descriptive subobjects.

    The var4 expression is an error in the syntax on my part. The correct syntax is shown, but I've had to embellish a bit here (next release of Reactor for you, so it won't work until I publish and you update).

    But here's the important part...

    As for the rest of it, you're making it unnecessarily hard, I think, because entity.primary_value will give you the value of the primary attribute, so you don't really need to care what capability that comes from and go to the work of classifying devices in expressions to try to make that work. There's an easier way.

    Based on what I see here, now that we understand you are actually trying to accomplish, what you really need to do is set those primary attributes in local_hubitat_devices.yaml, and skip all of the devices complexity you are creating here, and just use the primary_value from the entity in your sort/search expressions.

    To do the overrides in local_hubitat_devices.yaml:

    entities:
      # Entry shows how an entity can have a service added and its name forced
      "hubitat>76":
        # Name override
        name: "Attic Environmental Sensor"
        #
        # List of capabilities to add to this device (array)
        capabilities:
          - SomeAdditionalCapability
          - AnotherAdditionalCapability
        #
        # Assign primary attribute for this device
        primary_attribute: "temperature_sensor.value"
      "hubitat>178":
        primary_attribute: "x_hubitat_extra_attributes.batteryLastReplaced"
    

    Author of Multi-system Reactor and Reactor, DelayLight, Switchboard, and about a dozen other plugins that run on Vera and openLuup.

    wmarcolinW 1 Reply Last reply
    0
  • wmarcolinW Offline
    wmarcolinW Offline
    wmarcolin
    replied to toggledbits on last edited by
    #8

    @toggledbits

    Hi Master!

    Wow, good news that we will have in the MSR capacity, I am your test guy if you need a tester. And I'm aligned with you, I like to explore, learn, go to the limit, even with knowledge limitations, I seek to explore.

    I will keep the array structure that can put more dimensions, surely I will explore.

    Aligned from var4, I repeated your instruction and it really follows the syntax error, no problem for now, as I said we are learning and testing.

    Master I am trying, to follow the correct path, instead of going all the way around creating the array. I edited the file local_hubitat_devices.yaml to test with these 4 devices, and I see that in the capabilities now appears the DeviceGroup, but I don't see in the attributes, or way to add the value.

    # This file has local definitions/overrides for Hubitat devices.
    ---
    entities:
      # Entry shows how an entity can have a capability added and its name forced
      "hubitat>NNN":
        # Name override
        #name: "Attic Environmental Sensor"
        #
        # List of capabilities to add to this device (array)
        #capabilities:
        #  - Tone
        #
        # Assign primary attribute for this device
        #primary_attribute: "temperature_sensor.value"
      "hubitat>15":
        capabilities:
          - DeviceGroup
        group: "Window"
      "hubitat>67":
        capabilities:
          - DeviceGroup
        group: "Window"
      "hubitat>98":
        capabilities:
          - DeviceGroup
        group: "Door"
      "hubitat>99":
        capabilities:
          - DeviceGroup
        group: "Door"
    
    

    5568b50f-ca49-4312-a31d-b5389676d1a3-image.png

    09834c78-b201-4a80-8033-50ebe0d0e371-image.png

    Now I have a question, can I use this same file for the Vera devices? Following the same path?

    Thanks.

    1 Reply Last reply
    0
  • toggledbitsT Offline
    toggledbitsT Offline
    toggledbits
    wrote on last edited by
    #9

    You can't make up data. Just because you assign the capability DeviceGroup to the device, that doesn't mean you get to assign the attributes (group) that may be associated with that capability. Hubitat would have to provide the group data from its side -- the values for that attribute still have to come from Hubitat. And that probably won't be happening, because DeviceGroup does not appear to be a valid Hubitat capability.

    Author of Multi-system Reactor and Reactor, DelayLight, Switchboard, and about a dozen other plugins that run on Vera and openLuup.

    wmarcolinW 1 Reply Last reply
    0
  • wmarcolinW Offline
    wmarcolinW Offline
    wmarcolin
    replied to toggledbits on last edited by
    #10

    @toggledbits I understand, so in this case for now is to use the array resource that we discussed before, until you publish the news.

    f0a66684-76aa-4340-992f-bfd1d3900bfc-image.png

    Anyway thanks for one more class of knowledge.

    902b8160-4309-49fa-ae87-847684ccae9f-image.png

    1 Reply Last reply
    0
  • ElcidE Offline
    ElcidE Offline
    Elcid
    replied to toggledbits on last edited by Elcid
    #11

    @toggledbits said in Multidimensional Array:

    There is no === operator in the expression language, it's just ==

    Not according to your doc's.
    Screenshot_20211126-211238.png

    Also used in a test expression and working.

    Screenshot_20211126-211533.png

    Noted used "in" rather than "of" as I thought he wanted a 2D array not a object/dictionary.

    wmarcolinW toggledbitsT 2 Replies Last reply
    0
  • wmarcolinW Offline
    wmarcolinW Offline
    wmarcolin
    replied to Elcid on last edited by
    #12

    @elcid actually, for the final search result, it was easier with object/dictionary, but it could have been done by array as well. Thanks, you also taught me how to make an array that will be useful for sure, it always is.

    1 Reply Last reply
    0
  • toggledbitsT Offline
    toggledbitsT Offline
    toggledbits
    replied to Elcid on last edited by toggledbits
    #13

    @elcid said in Multidimensional Array:

    Not according to your doc's.

    You are correct, I'm suffering from holiday brain-fade.

    @wmarcolin Version 21331 just released has the first release of dynamic groups. It also includes a syntax enhancement to the expression first...in statement to allow a result expression, so it can return something other than what it finds (i.e. it can perform operations on what it finds and return that as a result). This is useful for your var4 of this post, which should be first dev,id of devices: dev.group=="DevDoor": id to give you the ID of the first matching device. But again, I think the combination of primary attribute assignment and dynamic groups is going to be the best way to solve this.

    Author of Multi-system Reactor and Reactor, DelayLight, Switchboard, and about a dozen other plugins that run on Vera and openLuup.

    wmarcolinW 2 Replies Last reply
    0
  • wmarcolinW Offline
    wmarcolinW Offline
    wmarcolin
    replied to toggledbits on last edited by
    #14

    @toggledbits Hi!

    Perfect, you have totally changed the command.

    first dev,id in var1 with dev.group=="DevDoor": dev.devid

    I'm going to study the dynamic group, because even though I can compare object or array contents, the usage is horrible. It's very difficult to validate an array inside another one, or to make combined selections.

    Well, I don't really know the language, so I'm having a hard time. Let's see if the dynamic groups can make something that should be simple easier.

    I'll return tomorrow with my experiences 🙂

    1 Reply Last reply
    0
  • wmarcolinW Offline
    wmarcolinW Offline
    wmarcolin
    replied to toggledbits on last edited by
    #15

    @toggledbits

    Hi Patrick!
    I don't know if I'm doing something wrong, but I followed the following steps to use DynamicGroupController.

    1. Stopped the MSR
    2. Compared the reactor configuration file
    3. Added the new Groups instruction, the one in the file is almost the same as the manual, and below is the one I set up.
      - id: groups
        enable: true
        implementation: DynamicGroupController
        name: Dynamic Group Controller
        config:
          groups:
            "low_battery":
              name: Low Battery Devices
              select:
                - include_capability: 
                  - battery_power
              filter_expression: > 
                entity.attributes.battery_power.level < 0.35
            "tripped":
              name: Tripped Devices
              select:
                - include_capability: 
                  - binary_sensor
                  - motion_sensor
              filter_expression: >
                entity.attributes.binary_sensor.state == true or
                entity.attributes.motion_sensor.state == true
    
    
    1. I restarted MSR + Tools Restart + Crtl+F5 🙂
    2. Search in Entities and I see that they are created, but without content

    7e621920-da8d-439e-b2b0-7018f0720fd1-image.png

    5e7fafc0-8c76-4868-95ce-4a4722cb6466-image.png

    1. Check if they are available for action, yes but also without content.

    332057ab-7718-4cc2-9253-dc5d33e2dd58-image.png

    1. As the master instructed, let's go to the log file.
    [latest-21331]2021-11-27T21:13:45.136Z <default:INFO> OWMWeatherController#weather done; 1 locations, 0 failed
    [latest-21331]2021-11-27T21:13:45.137Z <default:NOTICE> Controller OWMWeatherController#weather is now online.
    [latest-21331]2021-11-27T21:13:46.538Z <VeraController:NOTICE> Controller VeraController#vera is now online.
    [latest-21331]2021-11-27T21:13:46.540Z <default:ERR> error updating dynamic group low_battery_entries: Error: Invalid selector key
    [latest-21331]2021-11-27T21:13:46.541Z <default:CRIT> Error: Invalid selector key
    Error: Invalid selector key
        at DynamicGroupController._select (C:\MSR\reactor\server\lib\DynamicGroupController.js:260:23)
        at DynamicGroupController._update_group (C:\MSR\reactor\server\lib\DynamicGroupController.js:193:45)
        at C:\MSR\reactor\server\lib\DynamicGroupController.js:243:38
        at Array.forEach (<anonymous>)
        at DynamicGroupController._update (C:\MSR\reactor\server\lib\DynamicGroupController.js:240:95)
        at C:\MSR\reactor\server\lib\DynamicGroupController.js:150:42
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
    [latest-21331]2021-11-27T21:13:46.543Z <default:ERR> error updating dynamic group tripped_entries: Error: Invalid selector key
    [latest-21331]2021-11-27T21:13:46.544Z <default:CRIT> Error: Invalid selector key
    Error: Invalid selector key
        at DynamicGroupController._select (C:\MSR\reactor\server\lib\DynamicGroupController.js:260:23)
        at DynamicGroupController._update_group (C:\MSR\reactor\server\lib\DynamicGroupController.js:193:45)
        at C:\MSR\reactor\server\lib\DynamicGroupController.js:243:38
        at Array.forEach (<anonymous>)
        at DynamicGroupController._update (C:\MSR\reactor\server\lib\DynamicGroupController.js:240:95)
        at C:\MSR\reactor\server\lib\DynamicGroupController.js:150:42
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
    [latest-21331]2021-11-27T21:13:46.544Z <app:NOTICE> Starting HTTP server and API...
    [latest-21331]2021-11-27T21:13:46.552Z <app:NOTICE> Starting Reaction Engine...
    
    

    Well, I found this error, and obviously, I don't know how to solve it. What I did? I reinstalled the MSR, using only the config and storage directory, and the result is the same.

    1 Reply Last reply
    0
  • toggledbitsT Offline
    toggledbitsT Offline
    toggledbits
    wrote on last edited by
    #16

    The groups would be empty if there were no tripped or low battery devices in their respective groups, so that's not all conclusive; it may be perfectly correct. The groups at least appear to be correct, for empty groups (no entities matched).

    The time stamps in your log snippet are unrelated to the time stamp on the entities, so I can't really draw any conclusions from that either. If you post logs, make sure you are posting logs where the time stamps align to the problem you're reporting.

    On your conditions, you can't compare an array to an empty string; that's not a valid test.

    Author of Multi-system Reactor and Reactor, DelayLight, Switchboard, and about a dozen other plugins that run on Vera and openLuup.

    wmarcolinW 1 Reply Last reply
    0
  • wmarcolinW Offline
    wmarcolinW Offline
    wmarcolin
    replied to toggledbits on last edited by wmarcolin
    #17

    @toggledbits

    Ok let's go in parts, what I created in Group is the same thing I do in the traditional way and get the result, see the battery case.

    6bf50285-7862-4ba5-acd6-2c9eff9a0aec-image.png

    I'm not seeing an error anymore, after a reboot of the MSR host.

    [latest-21331]2021-11-28T02:45:18.584Z <default:null> Module httpapi v21308
    [latest-21331]2021-11-28T02:45:18.661Z <VeraController:null> Module VeraController v21324
    [latest-21331]2021-11-28T02:45:18.668Z <default:INFO> Structure#1 loading controller interface hubitat (HubitatController)
    [latest-21331]2021-11-28T02:45:18.676Z <HubitatController:null> Module HubitatController v21324
    [latest-21331]2021-11-28T02:45:18.679Z <default:INFO> Structure#1 loading controller interface groups (DynamicGroupController)
    [latest-21331]2021-11-28T02:45:18.686Z <DynamicGroupController:null> Module DynamicGroupController v21331
    [latest-21331]2021-11-28T02:45:18.688Z <default:INFO> Structure#1 loading controller interface weather (OWMWeatherController)
    [latest-21331]2021-11-28T02:45:18.693Z <OWMWeatherController:null> Module OWMWeatherController v21313
    
    
    [latest-21331]2021-11-28T02:45:18.761Z <default:INFO> Starting controller HubitatController#hubitat
    [latest-21331]2021-11-28T02:45:18.782Z <default:INFO> Starting controller DynamicGroupController#groups
    [latest-21331]2021-11-28T02:45:18.784Z <default:NOTICE> Controller DynamicGroupController#groups is now online.
    [latest-21331]2021-11-28T02:45:18.785Z <default:INFO> Starting controller OWMWeatherController#weather
    
    

    I see that the times are synchronized

    94523c4a-dd1f-4bc6-858a-351f010e4028-image.png

    But the array is still empty

    Any instructions where I can look for something?

    1 Reply Last reply
    0
  • toggledbitsT Offline
    toggledbitsT Offline
    toggledbits
    wrote on last edited by toggledbits
    #18

    The recommended debugging for this would be to start unraveling your criteria and see what it produces. As a first step (don't do this, just read), I would remove the filter_expression and make sure that your selectors are producing the expected set of eligible devices. An easy way to do that is to simply put an "X" in front of filter_expression (i.e. to make it Xfilter_expression), which changes the name of the key and hides it from the code that's looking for it. You could also comment it out, but that would require that you comment each subordinate line as well, which is more work and can be error-prone. Restart MSR after config changes, of course, and refreshes are also recommended (don't need to be hard refreshes).

    But, I found an error, and it's pretty subtle. For me, it logged one short line, so it would be easy to miss; I imagine you have it as well. But it's going to require a code change to fix, so I'll release another build later today. I'll also fix the doc issue you PM'd me about.

    Also, don't forget that filtering by controller or capability is a good way to quickly remove "noise" from your Entities list.

    Author of Multi-system Reactor and Reactor, DelayLight, Switchboard, and about a dozen other plugins that run on Vera and openLuup.

    wmarcolinW 2 Replies Last reply
    0
  • wmarcolinW Offline
    wmarcolinW Offline
    wmarcolin
    replied to toggledbits on last edited by
    #19

    @toggledbits

    I debugged removing filter_axpression entirely, and the variables are still empty. I'll wait for your version update and test again.

    1 Reply Last reply
    0
  • wmarcolinW Offline
    wmarcolinW Offline
    wmarcolin
    replied to toggledbits on last edited by
    #20

    @toggledbits well done

    Low Battery Devices charging perfect!

    a94effd2-b52f-4bf3-ac75-ddfd010df71d-image.png

    But there is a problem for "tripped", which repeated the same setting as "low_battery".

      - id: groups
        enable: true
        implementation: DynamicGroupController
        name: Dynamic Group Controller
        config:
          groups:
            "low_battery":
              name: Low Battery Devices
              select:
                - include_capability: 
                  - battery_power
              filter_expression: > 
                entity.attributes.battery_power.level < 0.3
            "tripped":
              name: Tripped Devices
              select:
                - include_capability: 
                  - binary_sensor
                  - motion_sensor
              filter_expression: >
                entity.attributes.binary_sensor.state == true or
                entity.attributes.motion_sensor.state == true
    

    This is what is showing up in the log.

    [latest-21332]2021-11-29T01:49:33.599Z <default:ERR> error updating dynamic group tripped: ReferenceError: Invalid reference to member state of null
    [latest-21332]2021-11-29T01:49:33.600Z <default:CRIT> ReferenceError: Invalid reference to member state of null
    ReferenceError: Invalid reference to member state of null
        at _run (C:\MSR\reactor\common\lexp.js:1369:31)
        at _run (C:\MSR\reactor\common\lexp.js:1233:34)
        at _run (C:\MSR\reactor\common\lexp.js:1290:44)
        at C:\MSR\reactor\common\lexp.js:1223:29
        at Array.forEach (<anonymous>)
        at _run (C:\MSR\reactor\common\lexp.js:1222:28)
        at Object.run (C:\MSR\reactor\common\lexp.js:1564:22)
        at DynamicGroupController._update_group (C:\MSR\reactor\server\lib\DynamicGroupController.js:229:141)
        at C:\MSR\reactor\server\lib\DynamicGroupController.js:267:39
        at Array.forEach (<anonymous>)
    
    

    Would I have to include any additional information in the configuration to not have this problem with null?

    1 Reply Last reply
    0

Recent Topics

  • DesTD
    RulesEngine
  • G
    OWM error
  • G
    Host time is wrong
  • G
    [SOLVED-ish] New iblind and zwaveJScontroller/MSR not communicating
  • therealdbT
    Replacing Nest Thermostat but....
  • H
    Connect small (torch-sized) light bulb to smart home network
  • toggledbitsT
    Reactor (Multi-System/Multi-Hub) Announcements
  • E
    Prensence sensor - client - base technologi
  • A
    Truncated web pages using wireguard over long distances
  • toggledbitsT
    Migration question
  • M
    docker synology import
  • therealdbT
    Smart bed sensor
Powered by NodeBB | Contributors
Hosted freely by 10RUPTiV - Solutions Technologiques | Contact us
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Unsolved
  • Login

  • Don't have an account? Register

  • Login or register to search.