nano is used to create the file “Dockerfile.pimaticnode” en edit it. You should run this on the host (e.g. directly on your pi), not from within the docker container.
-
Pimatic & Node 8.0
Every now and then I blog about pimatic at http://www.hendriks.software/tag/pimatic
-
Back on-topic: I think we have to plan for an upgrade to node js version 8. As of April 2018 maintenance on 4.x ends: https://github.com/nodejs/LTS#lts-schedule1
Every now and then I blog about pimatic at http://www.hendriks.software/tag/pimatic
-
Maybe that would help with my issue.
Its boring that i could Not run Pimatic and Magie Mirror on one pi. -
I have installed pimatic via docker with your image. Everything is working fine.
But the cron-timezone (UTC) on docker is different to the timezone on the hub (CEST).
How can I fix it?Sebastian
-
@shgmongo Try to run the container with option “-e TZ=Europe/Berlin”. If this does not help special action may be required to build the docker image including timezone maps and to setup the timezone as part of the entrypoint run script. For example:
Docker build
RUN apt-get update && apt-get install -y tzdata
Docker entrypoint script
# check if TZ is set, set to UTC otherwise, then execute: sudo dpkg-reconfigure -f noninteractive tzdata
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
Using the base image I always create a docker image that includes all plugins I use. Recently I have added something to fix the timezone in there:
RUN ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime
I prefer the solution above however…
Here is my complete dockerfile, for reference
FROM joshendriks/raspberry-pi2-pimatic:4 RUN ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime # Install pimatic modules RUN cd /home/pimatic-app && npm install --unsafe-perm mysql pimatic-homeduino pimatic-mqtt@0.9.6 pimatic-ds18b20 pimatic-node-red pimatic-smartmeter-gas pimatic-tplink-smartplug RUN cd /home/pimatic-app && npm install node-red-node-pushbullet RUN cd /home/pimatic-app && npm install node-red-node-smooth RUN cd /home/pimatic-app && npm install node-red-contrib-stoptimer RUN cd /home/pimatic-app && npm install node-red-contrib-http-request RUN cd /home/pimatic-app && npm install node-red-contrib-influxdb RUN cd /home/pimatic-app && npm install node-red-node-ping COPY config.master.json /home/pimatic-app/config.json # Run pimatic once so that all coffeescripts are built and npm packages are downloaded and built ## Make sure that pimatic will exit when startup is completed RUN cp /home/pimatic-app/node_modules/pimatic/startup.coffee /home/pimatic-app/node_modules/pimatic/startup.backup RUN sed -i "s/initComplete = true/framework.destroy().then( -> exit(0) )/g" /home/pimatic-app/node_modules/pimatic/startup.coffee ## Run pimatic RUN cd / && pimatic.js ## Restore startup.coffee and remove it from compiled cache RUN rm /home/pimatic-app/node_modules/pimatic/startup.coffee \ && mv /home/pimatic-app/node_modules/pimatic/startup.backup /home/pimatic-app/node_modules/pimatic/startup.coffee \ && rm /home/pimatic-app/node_modules/pimatic/.js/startup.* # Run pimatic.js at start of the container ENTRYPOINT ["pimatic.js"] EXPOSE 80 8000
Every now and then I blog about pimatic at http://www.hendriks.software/tag/pimatic
-
@mwittig
I tried your solution, but it doesn´t work. I don´t know why. Maybe it is my fault.@Jos-Hendriks
I will try your solution the next days. Thanks to you for your docker image. Pimatic works on my pi as a docker. I have now my own image, where everything is fine until the time zone. -
Are there any plans to migrate pimatic to node js 6.11 LTE or even version 8?
-
well, we need to do something … yes!
but what the best solution will be is still to be discussed.
maybe @mwittig or @sweetpi is able to tell morepimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebookmake it so !
-
Any news guys?
-
@dk00000 said in Pimatic & Node 8.0:
Any news guys?
No. Everyone is very busy these days. I am shooting for Xmas holidays
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@jos-hendriks said in Pimatic & Node 8.0:
Back on-topic: I think we have to plan for an upgrade to node js version 8. As of April 2018 maintenance on 4.x ends: https://github.com/nodejs/LTS#lts-schedule1
Is this critical?
hope that my pimatic works well also after april 2018 🙂 -
@dk00000 said in Pimatic & Node 8.0:
Is this critical?
hope that my pimatic works well also after april 2018Yes. Certainly your stuff will also work after April 2018, however, using unsupported software is a risk.
The dependency on 4.x already is blocking issue as some libraries used for plugins have dropped 4.x support."It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig did a short test with node v6 and v8 today. I found some glitches, had to update some dependencies but overall it doesn’t look too bad. Could you explain, what the biggest problems are?
BTW: if anyone wants to try: https://github.com/michbeck100/pimatic/tree/node_v8
I didn’t do any bigger testing, so be prepared that not everything will be working. Just make sure to do a clean install of pimatic.
pimatic-hap - pimatic HomeKit bridge
pimatic-echo - Amazon echo integration
pimatic-dash-button - Amazon dash button support
pimatic-alarm - pimatic alarm system
Like my work? Then consider a donation
Follow me: https://twitter.com/michaelkotten -
@michbeck100 I just noticed you upgraded coffeescript to 2.2.1.
I am surprised you were able to compile the code because for example this:
class ErrorDevice extends Device constructor: (@config, @error) -> @name = @config.name @id = @config.id super()
Should throw a coffee compile error because you can’t use this/@ on derived classes without first calling super()
-
@amit-patel you are right. I had to make this change to my own plugin pimatic-echo . Maybe this just breaks if the code gets actually executed? And if you don’t use the ErrorDevice the code is never reached.
pimatic-hap - pimatic HomeKit bridge
pimatic-echo - Amazon echo integration
pimatic-dash-button - Amazon dash button support
pimatic-alarm - pimatic alarm system
Like my work? Then consider a donation
Follow me: https://twitter.com/michaelkotten -
@michbeck100
FYI, I was just using ErrorDevice as a sample because it’s the first instance of in the devices file. There are dozens more just in that file. I mean, almost every device class uses that pattern.I don’t think it matters if it’s executed or not. Its a compile error, not a runtime error. I just tested this by popping the above into a file, and compiling using CS2, and sure enough, it fails:
$ ./node_modules/coffeescript/bin/coffee -cb test.coffee $/test.coffee:3:5: error: Can't reference 'this' before calling super in derived class constructors @name = @config.name
It makes me think that it’s not actually using locally installed lib.
-
@amit-patel THX for your finding! I fixed this now. The compiler says it’s ok .
pimatic-hap - pimatic HomeKit bridge
pimatic-echo - Amazon echo integration
pimatic-dash-button - Amazon dash button support
pimatic-alarm - pimatic alarm system
Like my work? Then consider a donation
Follow me: https://twitter.com/michaelkotten -
@michbeck100 btw, did you see this pull request I made in the core lib: https://github.com/pimatic/pimatic/issues/1084 ?
It’s a pretty simple fix, if you wanted to implement in your fork.
-
@michbeck100 BTW, you’re still referencing this before calling super()
Using this one as an example:
class LogActionProvider extends ActionProvider constructor: (@framework) -> super()
should be rewritten as
class LogActionProvider extends ActionProvider constructor: (framework) -> super() @framework = framework
Another approach would be to change the base ActionProvider class to
class ActionProvider constructor: (@framework) -> parseAction: (input, context) => throw new Error("Your ActionProvider must implement parseAction")
and then in all the extended classes you can just use:
class LogActionProvider extends ActionProvider constructor: (framework) -> super(framework)