- 20190324, V0.9.47
- Added minimal implementation for xAttributeOption displayFormat to support custom attribute
value formats with pimatic-mobile-frontend - Revised localization files, thanks @hvdwolf (nl.json)
- Updated dependencies
- Revised README
- Added minimal implementation for xAttributeOption displayFormat to support custom attribute
-
pimatic@0.9.47
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
Thx for the update. Nice to see that pimatic is back!
Did the update and everything works fine.One question regarding the custom format. I tried it but found no way to display the temp like 22°C as 22.0°C. The “0” will always be cut.
Should this work now as well or is this rounding function untouched? -
@ortin said in pimatic@0.9.47:
One question regarding the custom format. I tried it but found no way to display the temp like 22°C as 22.0°C. The “0” will always be cut.
Should this work now as well or is this rounding function untouched?Sorry, I still need to document the stuff. Documentation will be published at https://pimatic.teamemo.com/Advanced-Configuration/Attribute-Value-Formats
Regarding the fixed format filter you need to specify the number of digits to keep (default 0). For example:
fixed, decimals:1
EDIT: I have now added some baseline documentation to the Wiki (see link above)
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@ortin said in pimatic@0.9.47:
Thx for the update. Nice to see that pimatic is back!
Second that! Been waiting the update cycle for a while for more stable releases. Could anybody tell me which version of Node is preferred for the latest release?
(Maybe we should update the installation guide from the ‘How To’ section??)
edit:typo -
-
So I wanted to upgrade
Update info when starting the update:
Found update for pimatic: current version is 0.9.46, latest version is: 0.9.47 Found update for pimatic-mobile-frontend: current version is 0.9.13, latest version is: 0.9.14 Found update for pimatic-sysinfo: current version is 0.9.4, latest version is: 0.9.5
Het installeren van de updates is mislukt, bekijk het logboek voor meer informatie.
(Installing the updates failed, check the logbook for more information)When going back into the screen it mentions
pimatic is up to date. Found update for pimatic-sysinfo: current version is 0.9.4, latest version is: 0.9.5
npm WARN engine har-validator@5.1.3: wanted: {"node":">=6"} (current: {"node":"4.8.3","npm":"2.15.12"}) npm WARN engine punycode@2.1.1: wanted: {"node":">=6"} (current: {"node":"4.8.3","npm":"2.15.12"}) pimatic@0.9.47 node_modules/pimatic ├── cookie-parser@1.4.4 (cookie-signature@1.0.6, cookie@0.3.1) ├── connect-timeout@1.9.0 (on-headers@1.0.2, ms@2.0.0, on-finished@2.3.0, http-errors@1.6.3) ├── cross-spawn@5.1.0 (shebang-command@1.2.0, lru-cache@4.1.5, which@1.3.1) ├── method-override@2.3.10 (methods@1.1.2, vary@1.1.2, parseurl@1.3.2, debug@2.6.9) ├── cookie-session@1.3.3 (on-headers@1.0.2, cookies@0.7.3, debug@2.6.9) ├── logrotate-stream@0.2.5 (byt@0.1.0, log-rotate@0.2.8, optimist@0.6.1) ├── body-parser@1.18.3 (content-type@1.0.4, bytes@3.0.0, depd@1.1.2, on-finished@2.3.0, http-errors@1.6.3, qs@6.5.2, raw-body@2.3.3, debug@2.6.9, type-is@1.6.16, iconv-lite@0.4.23) ├── yet-another-jsonlint@1.0.1 (commander@2.19.0, JSV@4.0.2) └── request-promise@2.0.1 (bluebird@2.11.0, request@2.88.0) pimatic-mobile-frontend@0.9.14 node_modules/pimatic-mobile-frontend ├── colour.js@1.5.2 └── jqmthemer@0.0.1 (bluebird@2.2.2)
It is quite obvious that node is too old, but I simply did not think of it. Can this somehow be part of the upgrade?
If not as part of the upgrade, than as check: "if node < x.y then “stop upgrade. Give user message to upgrade node”.And secondly: Why only for the pimatic-sysinfo?
So: I downloaded the latest version 8 for my RPi3 on Stretch as it asks
wanted: {"node":">=6"}
wget https://nodejs.org/dist/latest-v8.x/node-v8.15.1-linux-armv7l.tar.gz
and installed it.
Pimatic doesn’t do anything.
So I stop/start pimatic withsudo service pimatic stop
andsudo service pimatic start
but nothing happens. Also the pimatic-daemon.log stops on the first line mentioning the date.I wanted to do a clean install with node 8.15 in place but that didn’t work.
So the warningwanted: {"node":">=6"}
is terribly misleading as it does not function with 8.
So I removed 8.15 and installed 6.17.0.
Then I did thenpm install pimatic --prefix pimatic-app --production
again and that seemed to work but not really.homeduino doesn’t function either. I removed the homeduino entries from the config.json but still no go. I have been trying for about 2 hours.
The only thing I could do in the end was to reinstall node 4.8.3 and restore my backup.
Sorry for the long post, but my experience might help others.
-
@harry-van-der-wolf said in pimatic@0.9.47:
npm WARN engine har-validator@5.1.3: wanted: {“node”:">=6"} (current: {“node”:“4.8.3”,“npm”:“2.15.12”})
npm WARN engine punycode@2.1.1: wanted: {“node”:">=6"} (current: {“node”:“4.8.3”,“npm”:“2.15.12”})
…
It is quite obvious that node is too old, but I simply did not think of it. Can this somehow be part of the upgrade?
If not as part of the upgrade, than as check: "if node < x.y then “stop upgrade. Give user message to upgrade node”.These messages are warnings and not harmful. I already saw them with earlier version of pimatic. They occur if certain dependency are freshly installed rather than applied from the package cache (or already installed in case of an update).
So: I downloaded the latest version 8 for my RPi3 on Stretch as it asks wanted: {“node”:">=6"}
…
wanted to do a clean install with node 8.15 in place but that didn’t work.
So the warning wanted: {“node”:">=6"} is terribly misleading as it does not function with 8.It is not a good idea to change to a new node.js major version with a existing node setup. This is not going to work in most case
hen I did the npm install pimatic --prefix pimatic-app --production again and that seemed to work but not really.
homeduino doesn’t function either.Yes, homeduino does not work with node v8 due to build issues with serialport. I am working on this
The only thing I could do in the end was to reinstall node 4.8.3 and restore my backup.
Yes, all updates work with node v4 what I have tested. Sorry for the confusion about the npm warning message. There is not much I can do about this right now."It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@stokstaart said in pimatic@0.9.47:
Could anybody tell me which version of Node is preferred for the latest release?
For the time being please stick to node v4.9.1 as described in the Wiki.
node v8 also works, but there are issues with some plugins, i.e. homeduino is known to have issues.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
The first issue with the upgrade was when running on node 4.8.3. It failed on the upgrade of pimatic-sysinfo.
Then I installed v8, which failed entirely, and then I installed v6.@mwittig said in pimatic@0.9.47:
@harry-van-der-wolf said in pimatic@0.9.47:
then I did the npm install pimatic --prefix pimatic-app --production again and that seemed to work but not really.
homeduino doesn’t function either.Yes, homeduino does not work with node v8 due to build issues with serialport. I am working on this
So the issue above is not with v8 but with v6.
This morning I installed node 4.9.1 and did the same upgrade again (as I had restored my previous version). I got the same issue on pimatic-sysinfo.
It turns out to be my own errorHowever, when trying to update it mentions: "Oops! Can’t update a git repository"
Somehow I installed the pimatic-sysinfo git repo in the past. Probably to solve an issue I had.
I did not see this “Oops! Can’t update a git repository” on 4.8.3. I got it now on 4.9.1.
I removed the complete folder from node-modules and upon start it automatically installed pimatic-sysinfo 0.9.5 and then got stuck: pimatic didn’t want to work at all.So I restored my previous complete pimatic-app tree and that worked.
Why is it failing when I remove the complete node-modules/pimatic-sysinfo?
-
And a completely different question.
Inside the users folder you can find.npm
folder containing (in my case) underpimatic
0.9.32 0.9.34 0.9.36 0.9.37 0.9.42 0.9.43 0.9.47
I assume I can safely remove the previous versions?
Only the last 2 seem to contain some Megabytes. The others not. But in the name of “good housekeeping” I like to get rid of unnecessary “stuff” -
@harry-van-der-wolf said in pimatic@0.9.47:
I assume I can safely remove the previous versions?
The .npm folder serves as a cache for package files to avoid downloading the same package multiple times. Generally, it is safe to remove its contents. The recommended was of doing this is:
npm cache clean [<path>]
In some cases, removing packages from the cache may result in a inconsistent cache base and npm no longer working. In this case a forced clean is suggested:
sudo npm cache clean -f
. Npm@2 will prompt you with the following warning in case.npm WARN using --force I sure hope you know what you are doing.
See also:
- https://docs.npmjs.com/cli/cache.html
- https://stackoverflow.com/questions/14842201/what-is-npm-dir-for
- https://stackoverflow.com/questions/20259492/npm-not-working-after-clearing-cache
My 2 cents: Only touch the npm cache if your file system is running out of memory.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
And some more confusion now that I read my own list back
I upgraded from 0.9.46 to 0.9.47 which is now successful apart from sysinfo, but 0.9.46 is not in the above mentioned list, and neither is 0.9.45 (which also gave me some hurdles to overcome).
It goes from 0.9.43 to 0.9.47.
Why? -
@harry-van-der-wolf said in pimatic@0.9.47:
Why is it failing when I remove the complete node-modules/pimatic-sysinfo?
I am not sure to be honest. Please try once again as follows:
- stop pimatic
cd node-modules
andrm -rf pimatic-sysinfo
- start pimatic
This should install the package on pimatic startup. Check log file for error messages.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@harry-van-der-wolf said in pimatic@0.9.47:
It goes from 0.9.43 to 0.9.47.
Why?Sorry, I can’t tell. I wiped my cache and installed 0.9.47 and in turn the cache has entries for 0.9.45 and 0.9.46. Possibly only packages are cached which are part of the dependency chain. Note, each plugin has a dependency on pimatic. These dependency do not get updated when pimatic is updated and this why there multiple versions of pimatic in the cache.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig said in pimatic@0.9.47:
@harry-van-der-wolf said in pimatic@0.9.47:
Why is it failing when I remove the complete node-modules/pimatic-sysinfo?
I am not sure to be honest. Please try once again as follows:
- stop pimatic
cd node-modules
andrm -rf pimatic-sysinfo
- start pimatic
This should install the package on pimatic startup. Check log file for error messages.
That is exactly what I did like I mentioned:
I removed the complete folder from node-modules and upon start it automatically installed pimatic-sysinfo 0.9.5 and then got stuck: pimatic didn’t want to work at all.
So I restored my previous complete pimatic-app tree and that worked.
Why is it failing when I remove the complete node-modules/pimatic-sysinfo?
There is nothing in the log either. That one also simply stops. I also rebooted and tried again as you never know what locks/pids are still in place.
I will do some further testing tonight.
-
@harry-van-der-wolf Did you manage to solve the issue?
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
At first I removed pimatic-sysinfo from
pimatic-app/node_modules
. Later I found also apimatic-app/.npm/pimatic-sysinfo
which I also removed, but that did only helped that the pimatic-sysinfo was correctly installed.But it still hangs upon starting. Now I switched the sysinfo plugin to false
{
“plugin”: “sysinfo”,
“active”: false
},Now pimatic starts, but I really want the sysinfo plugin.
The config for the systemsensor is
{ "id": "sysinfo", "name": "RPi3 sysinfo", "class": "SystemSensor", "attributes": [ { "name": "cpu" }, { "name": "dbSize", "interval": 300000 }, { "name": "temperature" }, { "name": "uptimeDHM", "interval": 120000 } ], "xAttributeOptions": [ { "name": "dbsize", "displaySparkline": false } ] },
I guess it hangs on
{ "name": "uptimeDHM", "interval": 120000 }
This is what I entered in my git repo as the uptime in seconds is totally useless after a few days, so I wanted it in DaysHoursMinutes. But that was already quite some time ago so I forgot.
When I remove that entry pimatic runs fine.
So it is obviously my own entry, but it would be more user-friendly if pimatic would display an error message like
You specified an unsupported value "uptimeDHM". pimatic will ignore it"
or something like that.I did that only Yesterday.
Tonight or tomorrow I will fork the pimatic-sysinfo again and do a pull request for a “systemUptimeDHM” and a “pimaticUptimeDHM”. -
I created a pull request that adds “systemUptimeDHM” and “pimaticUptimeDHM” that displays these uptimes as “days hours minutes”.
When less then an hour it only displays59 minutes
When less than a day it displays23 hours, 59 minutes
When more than a day it displays999 days, 23 hours, 59 minutes
in the config.json
{ "name": "systemUptimeDHM", "interval": 120000 }, { "name": "pimaticUptimeDHM", "interval": 120000 }
Example (just created from “fresh code” so pimatic uptime is extremely low)
Example 2:
-
@harry-van-der-wolf said in pimatic@0.9.47:
I created a pull request that adds “systemUptimeDHM” and “pimaticUptimeDHM” that displays these uptimes as “days hours minutes”.
Thank you very much for you PR! I am not sure, however, whether or not this is still required as there is the new
uptime
format as part of thedisplayFormat
xAttributeOptions
released with v0.9.14 of the front. For this reason I cherry picked your earlier PR (see my comments included in the PR). Note, beyond, I am planning to extend theuptime
format to let the user choose among several format options.See also:
- https://github.com/pimatic/pimatic-sysinfo/pull/13
- https://forum.pimatic.org/topic/4580/pimatic-mobile-frontend-0-9-14
- https://pimatic.teamemo.com/Advanced-Configuration/Attribute-Value-Formats
Please give it a try and let me know what you think. Nevertheless, I am open to accept your PR if that is the preferred solution.
When I remove that entry pimatic runs fine.
So it is obviously my own entry, but it would be more user-friendly if pimatic would display an error message like
You specified an unsupported value “uptimeDHM”. pimatic will ignore it"
or something like that.That’s odd. I’ll reproduce this case. If the error message indicates that “pimatic will ignore it”, it shall not cause pimatic to fail.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
I’m glad your memory is better than mine. I could not even remember I already had provided a PR, even though it was from 2016.
I will look at the displayFormat and xAtrributeOptions.
I said "if pimatic would display an error message like
"You specified an unsupported value “uptimeDHM”. pimatic will ignore it"
There was no error message at all. Just a halt.So again: it would be nice if pimatic could display such an error message and then ignore the value.