EZ-HouseMode-SceneRunner

@rlargent, you use the same username and password that you use for the https://home.getvera.com portal. Give that a try and let me know how it works out. If that doesn’t work, I can help you with some additional troubleshooting steps.

Ok, I confirmed that my username and password are correct but maybe I’m missing a quote or something.

Here is what I used to create the docker container and start it:

I changed my username and password so I’m not sharing private information.

docker run -it --network host --name ez-mode-scenerunner -e miosUser=username -e miosPassword=password ghcr.io/bblacey/ez-housemode-scenerunner

This is what I get when this runs:
Screen Shot 2021-08-27 at 10.23.31 AM

Agreed. If the credentials were incorrect, EZ-HouseMode-SceneRunner would tell you.

That said, EZ-HouseMode-SceneRunner uses mdns to locate the available hubs. This means that the EZ-HouseMode-SceneRunner host needs to be on the same network segment as your Ezlo Hub. If that is the case, then the next thing to check is that your hub appears in mdns. It looks like you are running on macOS so an easy way to check is to download the Discovery App from the App Store and check to see if Discovery “discovers” your Ezlo Hub.

Thanks for the reply, the discovery app definitely does see it.
Screen Shot 2021-08-27 at 12.27.11 PM

Perfect. That means that docker --network=host does not bridge like it does on Linux or Windows. So, I see 3 options - let me know which one you prefer.

  1. Run EZ-HouseMode-SceneRunner in docker on a Linux or Windows host (only if you have one available like an RPI, etc.).
  2. Run Node natively on macOS. The steps would be something like this (I will verify first if you want to use this option):
  • brew install npm
  • git clone https://github.com/bblacey/ez-housemode-scenerunner
  • cd ez-housemode-scenerunner/node-app
  • npm install
  • node index.js
    I run node natively on macOS for development and it is very straight-forward.
  1. I can modify EZ-HouseMode-SceneRunner to allow you to override the mdns search with a specific hub identity. This means that it would only work for a single hub that is probably 90% of the cases.

Let me know your thoughts.

Running locally may be best since I already have home-brew installed.
With this option how do I pass login credentials?

I have been playing around with option 2 and it had come to my attention that option 3 may be easier. If that is the case we can certainly go that way as well. I really appreciate the help with this.

Both option 2 and 3 are about the same and either will work equivalently well. The former means more work for you, the latter means more work for me :wink:. I’ll be happy to make the changes for you but might take me a little while (on the order of days). It is unfortunate that docker host networking is not bridged to allow mdns on macOS because the EZ-Apps really show their prowess when they discover and control all available hubs.

That’s should be easy, you just set the same environment variables before running node index.js. For example, in Terminal type the following to pass your credentials and use the default scene map:

$ miosUser=xxxx miosPassword=yyyy; node index.js

I’m still new to much of this stuff. I set the variables and still get the message below:
Maybe I forgot something.

Using scene map
{
“1”: “Return”,
“2”: “Leave”,
“3”: “Sleep”,
“4”: “Vacation”
}
/Users/richard/ez-housemode-scenerunner/node-app/node_modules/ezlo-hub-kit/lib/cjs/CredentialsResolvers/EzloCloudResolver.js:15
.update(username.toLowerCase())
^

TypeError: Cannot read property ‘toLowerCase’ of undefined
at new EzloCloudResolver (/Users/richard/ez-housemode-scenerunner/node-app/node_modules/ezlo-hub-kit/lib/cjs/CredentialsResolvers/EzloCloudResolver.js:15:30)
at Object. (/Users/richard/ez-housemode-scenerunner/node-app/index.js:26:18)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions…js (node:internal/modules/cjs/loader:1153: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:79:12)
at node:internal/main/run_main_module:17:47

Your persistence will pay off… The error seems to indicate that the username is blank or invalid because it fails when trying to convert the username to lowercase to create an internal hash value. So let’s try setting the environment variables in a way that you can verify their values before running the command.

export miosUser="username"
export miosPassword="password"

#Confirm that username and password are set to the correct values by writing them to terminal
echo $miosUser
echo $miosPassword

#Invoke the EZ-App
node index.js

If this version works and you want to use the one-line command above, you may just need to add quotes.

That worked! Thank you so much!

1 Like

Excellent! :+1:

Now that it’s working I have the functionality that I lost when upgrading controllers. Thank you so much.
I do have a question about how it runs. It seems to run the scene twice. Is this normal?
Screen Shot 2021-09-01 at 9.02.54 AM

Hmmmm, perhaps EZ-HouseMode-SceneRunner has two connections to your hub for some reason? Save your logs and try restarting EZ-HouseMode-SceneRunner and changing house modes to see if that resolves the issue. If so, then check the logs your saved to see if EZ-HouseMode-SceneRunner lost the hub connection and reconnected. If this turns out to be the case, then I will need to see if I can figure out the root cause and remedy.

Woops, I didn’t see the part about saving the logs until after shutting down and restarting.
I also rebooted the server.
It is now fixed.

1 Like