I want to have a vaiable which shows me the count of days to next chrismas ( for example 24.12.2017).
Is there a way to achieve this by making a rule which calculate a variable every day?
Hope this is understandable
greetings Toinmahoni
calculate a timeperiode in days (X days until Chrismas)
I want to have a vaiable which shows me the count of days to next chrismas ( for example 24.12.2017).
Is there a way to achieve this by making a rule which calculate a variable every day?
Hope this is understandable
greetings Toinmahoni
You could use ShellSensor to execute:
echo $(($(date -d 24-Dec +%j) - $(date +%j))) days left until christmas
cheers
DerIng
Thank’s very much, that works great.
But now I want to have a variable Input Device, whicht gets a Date. (I want to have a cuple of variables with Birthdates. Is there a way to use a variable to output the left days?
For example something like:
echo $(($(date -d VARIABLE +%j) - $(date +%j))) days left until christmas
VARIABLE = “24-Dec”
greetings
Tonimahoni
well, you can try to create a variablesinput device and use it in your above echo command as you already stated.
echo $(($(date -d $VARIABLE +%j) - $(date +%j))) days left
$VARIABLE must be changed to the name of your variablesinput device then.
not sure if this works but worth a try.
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !