Dummy device value (with formula or not)
Moderators: grovkillen, Stuntteam, TD-er
Dummy device value (with formula or not)
Hello everybody. Please tell me who knows. I want to create a dummy device that would show the value from a sensor with an additional calculation according to the formula. However, even without a formula, for example, I create an entry in the rules, and I don't get any value .... What am I doing wrong?
https://prnt.sc/1rk4c16
https://prnt.sc/1rk4ffh
https://prnt.sc/1rk4c16
https://prnt.sc/1rk4ffh
Re: Dummy device value (with formula or not)
In a rule you need an event like this:
Code: Select all
on Water_level#Distance do
TaskValueSet,9,1,[Water_level#Distance]
endon
Re: Dummy device value (with formula or not)
Please post messages as attachments in the forum so they are readable, also after a couple of weeks when the external service has cleaned them
Please post Rules etc. as Code in the forum, so we can properly read it.
Now my answer:
Your code isn't a complete rule yet. It needs to have defined on what event it should be executed, and the variable must be referenced correctly:
Please post Rules etc. as Code in the forum, so we can properly read it.
Now my answer:
Your code isn't a complete rule yet. It needs to have defined on what event it should be executed, and the variable must be referenced correctly:
Code: Select all
on Water_Level#distance do
TaskValueSet,Water_Volume,volume1,[Water_Level#distance] // calculate the volume from the distance here
endon
/Ton (PayPal.me)
Re: Dummy device value (with formula or not)
Thanks!Micha_he wrote: ↑08 Sep 2021, 11:55 In a rule you need an event like this:
Code: Select all
on Water_level#Distance do TaskValueSet,9,1,[Water_level#Distance] endon
Please excuse me. I wanted to attach images right here, but didn't figure out how to do it ... . And further, I don't quite understand how to write the formula correctly. For example, I need the volume1 value to be considered as ([Water_level # Distance] - 30) * 10.Ath wrote: ↑08 Sep 2021, 11:57 Please post messages as attachments in the forum so they are readable, also after a couple of weeks when the external service has cleaned them
Please post Rules etc. as Code in the forum, so we can properly read it.
Now my answer:
Your code isn't a complete rule yet. It needs to have defined on what event it should be executed, and the variable must be referenced correctly:Code: Select all
on Water_Level#distance do TaskValueSet,Water_Volume,volume1,[Water_Level#distance] // calculate the volume from the distance here endon
How to write it down correctly?
Re: Dummy device value (with formula or not)
That could be something like:
Code: Select all
on Water_Level#distance do
TaskValueSet,Water_Volume,volume1,([Water_Level#distance]-30)*10 // calculate the volume from the distance here
endon
/Ton (PayPal.me)
Re: Dummy device value (with formula or not)
If that doesn't work as expected, adding an extra indirection would help:Ath wrote: ↑08 Sep 2021, 15:17 That could be something like:Code: Select all
on Water_Level#distance do TaskValueSet,Water_Volume,volume1,([Water_Level#distance]-30)*10 // calculate the volume from the distance here endon
Code: Select all
on Water_Level#distance do
let,30,([Water_Level#distance]-30)*10 // calculate the volume from the distance here
TaskValueSet,Water_Volume,volume1,[var#30] // Could also use %v30% here
endon
/Ton (PayPal.me)
Re: Dummy device value (with formula or not)
It seems to have worked! Thank you very much for your help!Ath wrote: ↑08 Sep 2021, 15:17 That could be something like:Code: Select all
on Water_Level#distance do TaskValueSet,Water_Volume,volume1,([Water_Level#distance]-30)*10 // calculate the volume from the distance here endon
Re: Dummy device value (with formula or not)
Great, you're welcome, thanks for the feedback.
/Ton (PayPal.me)
Who is online
Users browsing this forum: No registered users and 122 guests