bertreb / pimatic-assistant

Plugin for connecting a Pimatic system via Nora to Google Assistant
MIT License
1 stars 0 forks source link

Nora eol #1

Open djmvt opened 3 years ago

djmvt commented 3 years ago

Hi,

Since nora is becoming pretty unstable and the dev announced he will no longer update nora and is working on a new variant, what will be the plan for pimatic assistant?

bertreb commented 3 years ago

Once the alternative is ready enough, i will migrate the plugin to the new Nora

djmvt commented 3 years ago

Is it possible to see the actual json that is generated with this plugin (like flows.json when exporting my own nodered flows)?

bertreb commented 3 years ago

I'm not sure what you mean, but you can see the actual states in the current nora cloud and in the debug log you see the info thats being send to nora

djmvt commented 3 years ago

What I mean is that when you make a flow in nodered you can export that flow for backup. I was wondering if that is possible with this plugin too or is it not working through nodered? Reason: I'm trying to find out how to create a thermostat in nodered (with smart nora) that shows values from my rooted toon thermostat and my temp sensors. But I have no clue how to accomplish that so I wanted to see how the actual flows look in nodered if they are created like that with the assistant plugin.

Ah nevermind, your plugin bypasses nodered.

bertreb commented 3 years ago

Yes, this plugin talks directly to the backend of Nora.

betz0r commented 3 years ago

Thanks for this great plugin. I guess NORA has reached EOL this weekend as the app is not reachable anymore on heroku. Furthermore the owner of NORA project announced today the launch of https://smart-nora.eu/ which is the direct followup software. @bertreb are you willing to migrate the plugin to smart-nora? :-) Thx in advance for your great effort.

EDIT: yes, its confirmed: https://github.com/andrei-tatar/node-red-contrib-nora/issues/112#issuecomment-821778595

djmvt commented 3 years ago

I've decided to leave the plugin route to connect to google assistant and do this completely in Node-red and smartnora. Thanks for the plugin @bertreb!

bertreb commented 3 years ago

The new Smart NORA is up-to-date and nicely integrated into node-red.
Because of that integration and the new buildup of Smart NORA its not possible to integrate it pimatic-assistant. To continue there are 2 options:

  1. you migrate towards a Node-red / Smart NORA solution (like @djmvt )
  2. you build your own 'old' Nora server. Pimatic-assistant can work with that, because i will make the plugin configurable for other Nora implementation on Heroku.
bertreb commented 3 years ago

The smartnora solution is released some weeks ago. I managed to get Smartnora working in a Pimatic plugin. If there is interest I can start releasing it. But using the node-red solution is also a very good way to integrate Smartnora.

betz0r commented 3 years ago

I would be interested in a solution in pimatic. Is it possible without hosting your own node-red?

bertreb commented 3 years ago

Yes, its without node-red

betz0r commented 3 years ago

Awesome, would be really nice to have pimatic devices available again in Google assistant without any further software.

djmvt commented 3 years ago

I'm happy with how it works for me now. Node-red offers a lot of flexibility in integration with Pimatic and google home/assistant. All devices I wanted to work in both Pimatic and google home seem to work now (except for tuya wich is still a hassle but I'm trying to phase out my tuya devices) and it's a great way to learn how to get these things done in node-red.

Thanks a lot for creating this plugin @bertreb

bertreb commented 3 years ago

I released the first version of pimatic-smartnora (0.3.9). This release supports switch, dimmer and button devices. This release id to test the setup with some device types. The working is about the same as in pimatic-assistant. Some differences in the plugin config and new registration in the smartnora site. More info on installation and configuration -> pimatic-smartnora

betz0r commented 3 years ago

Thank you very much for you first version. After some oauth hickups I got it setup correctly and it worked for about a day, since this morning devices are not responding anymore, smart Nora stated last updated 4:40am today. I edited the device list of the smart nora device, it got synced to google home app and smart-nora.eu also shows the correct updates timestamp but devices are still not responding in Google home app. I turned on debugging for the smartnora plugin but no debug information is logged. It might be an issue on smart nora side. Anyone experiencing similar behavior?

bertreb commented 3 years ago

I got 2 questions:

  1. what were the oath hick-ups?
  2. what happens when you restart pimatic?
betz0r commented 3 years ago
  1. The acceptance of the data agreement did not add the smartnora account to google home app list. After opening the link several times in chrome itself instead of WebView it suddenly worked. Unreproducable for me what was the reason it didn't work in the first place.
  2. Restarting pimatic fixed the not reachable issue of devices, it works again.
bertreb commented 3 years ago

Ok thanks. I'm also doing a test and check if devices are staying online. Lets see what happens the next day(s).

betz0r commented 3 years ago

It worked fine until i containerized pimatic with docker. I pulled a preconfigured image from dockerhub which has version of nodejs v8.10.0. During startup of pimatic i get errors that used library "cbor" needs at least nodejs v10.18 or higher. I have troubles compiling sqlite3 from sources on my raspberrypi3, that's why i moved to a containerd version of pimatic to move around that issue.

Steps to reproduce: 1) docker pull treban/pimatic-rpi:node10 2) used existing config.json from previous pimatic instance with smartnora plugin installed and activated, smartnora device added and added selected devices to smartnora device. 3) start pimatic as container with node version v8.10 Result: all works fine except smartnora device has no options and is not syncing with smartnora, i guess because of wrong version of node for cbor. Pimatic log output: The cbor package REQUIRES Node.js v10.18 or higher. You are currently running Node.js v8.10.0 Please upgrade node, or pin cbor to version 5.2.x: npm install --save cbor@5.2

npm list cbor says:

`-- pimatic-smartnora@0.3.9
  `-- node-red-contrib-smartnora@1.0.5
    `-- cbor@6.0.1

Question/Pullrequest: Is it possible to use a similar library to cbor or a version of cbor compatible with nodejs v8.10 to be able to run smartnora plugin on this particular docker image for raspberry pi with nodejs v8.10?

bertreb commented 3 years ago

The package you mention is part of the node-red-contrib-smartnora library i use. Thats not something i can change. And yes, the minimum node requirement for that package is 10.18+. For testing I sometimes run pimatic with node 10.22 in docker.

betz0r commented 3 years ago

Okay, thanks for your quick response, could you maybe provide a docker image with pimatic and node v10.18 or v10.22 ? I am still running into issues because its not possible for me to compile sqlite3 on this raspberrypi3 - even in docker. It's just annoying, sadly.

bertreb commented 3 years ago

I used in commandline mode 'docker run -d -p 8282:8282 -v /data-path:/data treban/pimatic:latest'.

betz0r commented 3 years ago

Well... that works perfect. Didn't know i could use the non-rpi image also on the rpi. Thanks and have a nice public holiday!

bertreb commented 3 years ago

With this command automatically the latest image for the right os/arch will be selected. For treban/pimatic:latest, linux/amd64, linux/arm/v7 and linux/arm64 are available (see docker hub). In your case linux/arm/v7 is used.

betz0r commented 3 years ago

Smartnora worked perfect the other days, right now it does not as pimatic devices are not reachable from google home. Recreating Smartnora device and resyncing didn't help. After pimatic restart, nora: connected and nora: synced message it worked again (automatically, nothing manually done) How can i debug this further?

bertreb commented 3 years ago

When you use the docker image you got this problem? I have a pimatic switch connected to google home now for days and it still works. You can start testing with 1 simple pimatic switch device and see if that stays stable. And then add a second different type of device, etc.

betz0r commented 3 years ago

Same situation again this morning, smart nora devices are not reachable from Google Home. Pimatic (in docker container) itself works great without any issues, smartnora plugin doesn't debug any information just smartnora connection does not work. A sync event is logged around 4:35 this morning. I guess that might be the issue as it still worked around 2 in the morning. As this is getting very specific for pimatic-smartnora, should we create a new issue in https://github.com/bertreb/pimatic-smartnora ?

bertreb commented 3 years ago

You can make an issue in pimatic-smartnora, but still there's some work to do for you, to debug your specific setup. I can't reproduce the problem, my switch device is still working. I will add also a smartnora docker test with 1 switch device.

Steps you should take:

  1. start with only 1 switch device and see if the problem is still there. Use a DummySwitch device.
  2. check if you got more then 1 smartnora running (pimatic development system or node-red). If you use a group name in more places the config will be overwritten with the latest active config. Use different group names to avoid that problem.
  3. test it without docker. If the problem then still exists its not the docker environment