@Anduril
you could try to use the variables device for displaying the value of the timer
-
Butten used as Timer
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebookmake it so !
-
Example from my config:
{ "variables": [ { "name": "tijd", "expression": "$pumptimer.time", "type": "number", "unit": "s", "label": "", "discrete": false, "acronym": "" }, { "name": "tijd-todo", "expression": "$PumpHoursToDo", "type": "number", "unit": "s", "label": "", "discrete": false, "acronym": "" }, { "name": "tijd-left", "expression": "$PumpHoursToDo-$pumptimer.time", "type": "number", "unit": "s", "label": "", "discrete": false, "acronym": "" } ], "xLink": "", "id": "timer-display", "name": "gemaakte uren / uren te gaan / resterende uren", "class": "VariablesDevice" }
Like my projects and help? Consider donating electroneum etnjwAKGPqF6omQWRmpp9u2BPyVDG9VuyRQjNJ1S8yfBdfR9qeUQ46kRy8KS2CNqbpNLRrsgmNW6F2TMzxmZgPrh6KctrkrYbm
-
ok thanks a lot for all your help. I tried using a timer device and the rule according to p4co86.
Is there an option to manually edit the timer variable? And when displaying the time in a variable device I only get the number of seconds. Is it possible to display in a h:mm format?
Same for the rule option, I can count the minutes, but displaying it in h:mm format seems difficult. I can manually split (if minutes>60 then minuten=minutes-60 and hours=hours+1) but in a variable device I see the graph between to variables. Can I turn this graph off? -
You could say, if variable = 60 then set hour.variable to 1 and min variable to 0 or if min.variable = 120 then set hour.variable to 2 and min.variable to 0
Than display both variables in one variables device.
Its untested. But you can try a little bit and it should work. -
If you set the unit in S (like my example) the time will be automaticly converted in Hs format
Like my projects and help? Consider donating electroneum etnjwAKGPqF6omQWRmpp9u2BPyVDG9VuyRQjNJ1S8yfBdfR9qeUQ46kRy8KS2CNqbpNLRrsgmNW6F2TMzxmZgPrh6KctrkrYbm
-
the hint with the units was good, but not the finish line. Two problems: with unit s you also get seconds, which is not very nice as I only update the timer every 60s. Second I don’t know how to manipulate the timer value by hand.
But searching for suitable units lead me to the function formatNumber, which will convert a number to a string and therefor eliminate the log and graph. Only problem is that this assumes the value has a unit itself and sets B if not stated other. Can I somehow set it to be a pure number and give a unit by “unit” definition of the variable device? -
{ "class": "SystemSensor", "id": "db-size", "name": "Datenbankgröße", "attributes": [ { "name": "dbsize", "interval": 3600000 } ], "xAttributeOptions": [ { "name": "dbsize", "displaySparkline": false } ] },
With the xattribute displaysparkline you can disable the graph and the type can be still number.
-
Thank you @p4co86 , thats exactly what I wanted. Now it’s nearly perfect. Just 2 details, maybe you know how to solve them:
- I have my time recording to track minutes and hours and show an average over a week. It looks just a litte funny when the average is given in X.XX minutes. Is it possible to round to full minutes?
- Is it also possible to edit the sparkline? I think of an sparkline showing the average of the last weeks, but normal sparkline shows only for a shorter time (don’t know if it’s determined by number of datapoints or time).
-
first: you can round a variable like this $variable2 = round($variable1,2) were 2 means two decimal. but i dont no if it works for a timer.
second: i dont now, but i mean there is no option to edit the sparkline. -
Thanks @p4co86 , that worked. I added it directly to my variable device. I don’t use a timer device but a variable that is counted up every minute by a rule as you suggested in your first post.
I will try a litte with the sparkline, in case of succes I will post here for others to read.