Is there a way to use the mysensors distance sensor (http://www.mysensors.org/build/distance) with pimatic? I want to use it as a cistern level monitor.
As I see it, it sends the distance to the water surface in cm.
How to convert from centimeters to percent automatically?
It must something like (maxdistance - echodistance / maxdistance * 100) but where?
-
mysensors Distance Sensor
-
The plug-in supports the distance sensor in cm. Why do you want it in %?
-
maybe you could do it with as a workaround with a variablesdevice.
at the expression of the variables device you can calculate with your variables and set the unit to %.
this just as quick and dirty explanation - hope it helps.just took the time to create it - could be something like that where i guess maxdistance is a given value and echodistance is a variable comming from the mysensor device.
maybe you should check the expression if the calculation is correct. otherwise set some more brackets.{ "id": "distance-sensor", "name": "Mysensor Distance", "class": "VariablesDevice", "variables": [ { "name": "Distance", "expression": "(maxdistance - $echodistance / maxdistance * 100)", "type": "number", "unit": "%" } ] },
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebookmake it so !
-
could also be done with a rule which updates a variable as soon as the sensor value changes
-
@thex said:
could also be done with a rule which updates a variable as soon as the sensor value changes
and then use a variablesdevice to show it
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebookmake it so !
-
Ok, i will test it, if the distance sensor has arrived.Thanks in advance!
@sweebee said:
The plug-in supports the distance sensor in cm. Why do you want it in %?
Because i want to show the fill level of the cistern. If I only show the cm no one will know what it means.
-
@leader21 said:
maybe you should check the expression if the calculation is correct. otherwise set some more brackets.
OK, had to set some more brackets:
{ "id": "distance-sensor", "name": "Füllstand", "class": "VariablesDevice", "variables": [ { "name": "Füllstand", "expression": "( ( $maxdistance - $echodistance ) / $maxdistance * 100)", "type": "number", "unit": "%" } ]
Also set maxdistance as variable for easy changing over GUI.
But still waiting for the sensor. -
ok, pls. tell us about your findings, but should work with the variablesDevice.
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebookmake it so !