nice!
@leader21 how did you realise the ‘Pimatic Free Space’. As a shell script? I don’t see it as part of the sysinfo plugin…
pimatic version in the UI
nice!
@leader21 how did you realise the ‘Pimatic Free Space’. As a shell script? I don’t see it as part of the sysinfo plugin…
haven’t created this, that’s sebastiens idea. but generally it should work like this :
the freespace can be calculated via variable.
you 're having the used space via syssensor plugin.
then you can create a variable $freespace and a rule to calculate the freespace
IF $usedspace changes THEN $freespace = disksize - $usedspace
or maybe you can use the shellsensor plugin to grep the value from df command or similar.
then you can use the variable within a variables device
maybe @sebastienvg wants to share his idea with us?
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
@sebastienvg said:
@leader21 did I ever mention how many smart asses hang around that place?
well, sometimes it can be so easy that you don’t even try to think of it as solution.
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
@sebastienvg why not the easy way, all in the shellsensor?
like this:
{
"id": "pimatic-version",
"name": "pimatic version",
"class": "ShellSensor",
"attributeName": "version",
"attributeType": "string",
"command": "cat /usr/local/node_modules/pimatic/package.json |grep version\\\": |awk {'print $2'}|sed 's/,//g' |sed 's/\"//g'",
"interval": 180000
},
greetings
jensebub
@jensebub said:
cat /usr/local/node_modules/pimatic/package.json |grep version\": |awk {‘print $2’}|sed ‘s/,//g’ |sed ‘s/"//g’
well because I am never sure the amount of \\ I’ll need to escape
Pimatic, smart home made by smart folks, for the rest of us!
@sebastienvg i used the “try&error-method” but it seems to be logical,… you have to escape all which could end or irritate parsing in the config.json,… like \
and "
and so the result is:
"command": "cat /usr/local/node_modules/pimatic/package.json |grep version\\\": |awk {'print $2'}|sed 's/,//g' |sed 's/\"//g'"
try this tool for escaping characters
http://bernhardhaeussner.de/odd/json-escape/
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
you’re welcome!
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
you’re welcome