Home Assistant add-on
-
Sorry if I'm being dense here this morning - this is to link an existing MSR installation to HA vs having to manually create the long-lived key and manually update configs?
-
@RogerO Yes, I believe you understand the ask. I already have HA and MSR on sep RPi's, linked via config, and even shared MSR within a HA dashboard. Was looking to see if this streamlined any of that but it sounds like it's not something I would need.
-
Hello,
Trying to install this and getting the following in the logs:2023-02-07 00:26:46,034 INFO exited: reactor (exit status 1; not expected)
2023-02-07 00:26:47,044 INFO spawned: 'reactor' with pid 3569
Using existing set-up
Reactor Token is set, updating config
Reactor latest-23028-ddc3fb14 app 22364 configuration from /config/reactor
NODE_PATH /opt/reactor:/opt/reactor/node_modules
2023-02-07 00:26:48,154 INFO success: reactor entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
node:internal/fs/utils:345
throw err;
^
Error: ENOENT: no such file or directory, open '/config/reactor/logging.yaml'
at Object.openSync (node:fs:585:3)
at Object.readFileSync (node:fs:453:35)
at Function.loadConfig (/opt/reactor/server/lib/Configuration.js:226:68)
at Function.getInstance (/opt/reactor/server/lib/Configuration.js:144:66)
at Object.<anonymous> (/opt/reactor/app.js:105:97)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/config/reactor/logging.yaml'Looked in the/opt directory and it was empty. Getting a bad gateway error when I try to load the page.
Thanks,
Roger -
mrw298replied to RogerO on Feb 7, 2023, 9:49 PM last edited by mrw298 Feb 7, 2023, 4:50 PM
@RogerO somethings a bit odd has gone on. First time the container starts it copies the files from /opt/reactor/dist-config to /config/reactor and does a basic setup.
You should be able to stop the container, delete the /config/reactor directory and start it back up again to recreate the config.
That does rely on the dist-configs existing and it’s strange that /opt is empty. Do you know which architecture you’re running, perhaps there’s a difference between the images.
-
Currently running HASSIO on a RPI4
Home Assistant 2023.2.2
Supervisor 2023.01.1
Operating System 9.5
Frontend 20230202.0 - latestUninstalled the addin and deleted the reactor.yaml file. Installed the addin and if choked because it couldn't find yaml file. Using winscp I created one and it will not start. /opt/ is empty.
-
The
/opt
directory contents are inside the container and not visible without attaching to the container. I'm not surprised you don't see anything there; it's expected, actually. Beyond that, @mrw298 will need to respond for the add-on. -
oh yeah, forgot that part.
-
-
I am using the addon for HA, running excellent.
Finally my dream came true, using the excellent reactor engine to automate all my devices, mix and match rules and technologies.
Will offload now finally from my rusty Vera Lite to HA...Two things: I keep getting the "reminder" to enter the last four digits despite having done it multiple times.
Can I safely update MSR from within the addon or do I need to wait for an update to the addon? -
toggledbitsreplied to kellyjelly32 on Mar 8, 2023, 2:44 PM last edited by toggledbits Mar 8, 2023, 9:46 AM
@kellyjelly32 said in Home Assistant add-on:
Two things: I keep getting the "reminder" to enter the last four digits despite having done it multiple times.
Off the top of my head, it sounds like you may not be entering it correctly? They aren't just digits, usually. Check to make sure your browser settings to allow cookies. Also generally, if you're reporting a problem like this, you should include the version information for the browser you are running, and in fact, you should go review the posting guidelines for this category because your post generally doesn't meet the requirements. This question should be separate from your other question in its own thread, also.
-
@toggledbits
I am running the addon in v0.0.7 (2023-02-20) [which is using Reactor build 23049 as per changelog] with:
Home Assistant 2023.3.1
Supervisor 2023.03.1
Operating System 9.5
Frontend 20230302.0 - latestI was more trying to reach @mrw298 as he is the creator of the addon. Judging from the changelog, I can´t update MSR that simple and need to wait for a new version of his addon to be pushed.
The reminder pops up in any browser I tried so far, probably because it can´t really create a cookie. It even pops up in the HA mobile app. But I think the reactor front-end was never designed to run in such an environment. It is a minor cosmetic nuisance.
-
@kellyjelly32 I sometimes lag a bit behind @toggledbits packaging it up for HA (especially if I don't notice a new version), I've just pushed a new version of the addon with Reactor build 23063 in it.
I've noticed that prompt coming back too, it's probably something to do with how I've wedged reactor into an HA addon, will see if I can figure out what needs tweaking to make it go away.
-
@RogerO sorry for the delay responding, if the files are in dist-config I'm not quite certain how it's going wrong!
On startup it copies those files from /opt/reactor/dist-config -> /config/reactor if the /config/reactor directory doesn't exist.
If it can't find logging.yaml that steps failed and stopping the addon, deleting /config/reactor and restarting it should get it to retry.
The addon logs of that first start would hopefully contain any error messages.
-
After doing some tinkering again this weekend on my HA real-life system, I noticed that the "global expressions" are not persistent when rebooting / restarting the MSR addon for HA. "global reactions" survive a reboot, as do all the rules (with their reactions / untested with local expressions). Ultimately it is probably an issue with the addon, not with MSR. Just want to see/hear from @toggledbits if there is something special about how the global expressions are saved vs the other stuff.
-
@kellyjelly32 said in Home Assistant add-on:
"global expressions" are not persistent
Not sure what this means. Can you explain in more detail?
@kellyjelly32 said in Home Assistant add-on:
"global reactions" survive a reboot
Reactions are stateless. There's no need for them to "survive a reboot" because there's nothing to survive. Again, not sure what this means, and detail would be helpful.
-
"Global Expressions" aka those things you can define and use for variables and calculations don't survive a reboot. After a reboot they are gone. The whole page with global variables is empty. I need to define them again. All rules which use one of these "global expressions" have a little yellow warning triangle and in the rule, be it conditions or actions or reactions, they are stated as "missing".
As my system usually runs extremely stable I never noticed it as it never rebooted. Until this weekend when I physically had to shut it down and reboot a few times.
I think it is a HA addon issue from @mrw298 not from MSR itself. -
toggledbitsreplied to kellyjelly32 on May 29, 2023, 12:30 PM last edited by toggledbits May 29, 2023, 8:34 AM
@kellyjelly32 said in Home Assistant add-on:
After a reboot they are gone. The whole page with global variables is empty.
OK, that's beyond what I would have guessed from your initial description. I interpreted you to mean that their values are not preserved and are being updated when Reactor starts, but this condition you describe is far beyond that and definitely not the way Reactor is intended to work. That suggests to me that the storage data for at least global expressions, and maybe more you haven't yet detected, isn't being written properly. This could be the fault of a corrupted storage file (i.e. the
expressions.json
file in thestorage
subfolder), or improperly configured storage entirely (i.e. the bind mount needed isn't properly set up), or the shutdown by Hass, when it is asked to restart the Reactor add-on, shuts it down in some disorderly way to Reactor/nodejs, so it can't write the storage files (i.e. it gets killed rather than signalled to quit, so it can't perform its cleanup and tidy exit function). If it's the last case (bad shutdown), then you'd probably also notice other changed objects (reactions, rules) are not preserving their changes as well.If the file is corrupt, you would find logged errors that look like this:
<SingleFileStrategy:ERR> [SingleFileStrategy][SingleFileStrategy#/home/pi/Documents/MSR/storage/expressions.json] error reading /home/pi/Documents/MSR/storage/expressions.json: [SyntaxError] Unexpected token { in JSON at position 1 [-]
Check for these messages at startup, and any time you attempt to navigate to the
Expressions
page in the UI. You may also see similar messages at shutdown. If there are messages at shutdown, as well as messages for other files in storage, then it suggests that the storage isn't properly configured (issue with the bind mount, or file permissions in the mounted directory, for example). In any case, if the file is corrupt, you can just remove it and restart Reactor (and then rebuild your expressions; if you are handy with JSON, you could try to repair the file).But yes, in a normally functioning Reactor system, Rules, Reactions, and Expressions that you create should be saved and return after a restart/reboot as they were before the restart/reboot. Something is definitely amiss there, but it could just be a local configuration issue, not an add-on problem (I would assume some of the other folks using the add-on are consumers of global variables and we haven't seen reports like this from others as yet).
Edit: storage volume (disk) full is also a way to get corruption of storage data and/or unsaved changes.