Hello,
I'm trying to create notification on high and low water pressure with blocky, but events are not fired.
If I change condition (with time for instance), the event is fired, I'm able to read the value from log (for instance 1.939).
Another problem, the message I get in notification mail is "utilitydevice[249]" instead of 1.939.
Any idea?
Comparison with custom sensor value is not working Topic is solved
Moderator: leecollings
-
- Posts: 140
- Joined: Wednesday 02 December 2015 21:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: France
- Contact:
-
- Posts: 20
- Joined: Thursday 29 December 2016 9:16
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Comparison with custom sensor value is not working
I’m not sure what you mean but that script will probably not work as you think since ”else if” statements are borked in Blocky. It’s like stacking if:s in a row and I doubt anything will be fixed regarding that any day soon since it been there since the introduction. So stay away from else ifs...or use ANY other supported language.
-
- Posts: 140
- Joined: Wednesday 02 December 2015 21:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: France
- Contact:
Re: Comparison with custom sensor value is not working
I read the post on the "else if" problem, I don't think I'm concerned, I don't receive any notification in my example above, and my real script is this one: I want to have a notification when water pressure is too low or when water pressure is too high ("Pression de l'eau du chauffage" is "heater water pressure", from a custom sensor created with ebusd python plugin).Spitfire wrote: ↑Sunday 17 December 2017 0:59 I’m not sure what you mean but that script will probably not work as you think since ”else if” statements are borked in Blocky. It’s like stacking if:s in a row and I doubt anything will be fixed regarding that any day soon since it been there since the introduction. So stay away from else ifs...or use ANY other supported language.
-
- Posts: 77
- Joined: Sunday 06 September 2015 11:58
- Target OS: Linux
- Domoticz version:
- Contact:
Re: Comparison with custom sensor value is not working
I use "else if's" successfully in several blocklys.
Your test script has an error, If its larger that 2.5, it is also larger than 1.5. Have you tried changing the script type?
Your test script has an error, If its larger that 2.5, it is also larger than 1.5. Have you tried changing the script type?
-
- Posts: 140
- Joined: Wednesday 02 December 2015 21:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: France
- Contact:
Re: Comparison with custom sensor value is not working
The script of the first post is wrong on purpose: I was trying to force comparison to be true (pressure is around 2) to check if I receive a notification, but nothing received... For the real script, see the 3rd postcogliostrio wrote: ↑Sunday 17 December 2017 22:02 I use "else if's" successfully in several blocklys.
Your test script has an error, If its larger that 2.5, it is also larger than 1.5. Have you tried changing the script type?
-
- Posts: 20
- Joined: Thursday 29 December 2016 9:16
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Comparison with custom sensor value is not working
Else if does not work as they should period.
However you can of course use them as stacks of if:s...if that is what you want.
In the first example above both the if and else if will be executed if the value is above 2,5 and I do not think you want that.
However you can of course use them as stacks of if:s...if that is what you want.
In the first example above both the if and else if will be executed if the value is above 2,5 and I do not think you want that.
-
- Posts: 140
- Joined: Wednesday 02 December 2015 21:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: France
- Contact:
Re: Comparison with custom sensor value is not working
It doesn't work either with a single if statement, I have nothing in log:Spitfire wrote: ↑Monday 18 December 2017 20:43 Else if does not work as they should period.
However you can of course use them as stacks of if:s...if that is what you want.
In the first example above both the if and else if will be executed if the value is above 2,5 and I do not think you want that.
-
- Posts: 140
- Joined: Wednesday 02 December 2015 21:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: France
- Contact:
Re: Comparison with custom sensor value is not working
Ok, now it works, it was a bug in my ebusd python plugin, the pressure was declared as text instead of bar custom sensor, i was never considered as a number
Who is online
Users browsing this forum: No registered users and 1 guest