Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

" and " in rules either not implemented or not working. #33

Closed
Budman1758 opened this issue Feb 12, 2019 · 5 comments
Closed

" and " in rules either not implemented or not working. #33

Budman1758 opened this issue Feb 12, 2019 · 5 comments
Labels
awaiting for feedback More details or tests needed

Comments

@Budman1758
Copy link

I have a rule I am trying to use with an "and" statement in it. I know this was implemented in ESPEasy but not sure about here.

The rule I am using....
if [station#hours]>47 and [auto#switch]=0 do This evaluates as false. The switch is indeed at "0" and the station hours are indeed more than 47
if [station#hours]>47 Evals as true by itself
if [auto#switch]=0 Evals as true by itself.
Like the issue title says. Either not implemented or not working.
If not implemented can you? :)
If a bug, can you exterminate? :)
No big rush. Whenever you have the time.....
Thanks again for this awesome software!!

@enesbcs
Copy link
Owner

enesbcs commented Feb 12, 2019

It's interesting as "and" worked in my first testings.. could you switch Log level to Debug and see "Parsed condition" lines? I will check it today evening. /it's morning now here :) /
In fact "and" is not implemented by me, i am using the Python Eval() command to evaluate expressions. There must be some string related problems such as 0.00 is not equal to 0 or type mismatch. Could you add some detail about "station" and "auto"?

@enesbcs enesbcs added the awaiting for feedback More details or tests needed label Feb 12, 2019
@Budman1758
Copy link
Author

"Station" is a dummy device where I store values. The hours value is incremented up 1 every hour. After a set time this value is used to start the watering sequence. So [station#hours] is just a dummy value.
"Auto" is a switch connected to a PI GPIO. "auto" is the switch name and "switch" is the value name. So [auto#switch is simply a switch that is either 1 or 0. (input pullup) in the hardware settings.

192.168.1.62 Feb 11 22:35:00 RPIEasy kern debug Irrigation Parsed condition: if 48>47 and 0=0 False

Debug Developer Level. Above line is all that shows. I get that via syslog. I do not have serial connected. If need be I can set that up.

@enesbcs
Copy link
Owner

enesbcs commented Feb 12, 2019

== is not equal to = in python.. using eval() is convenient choice, but equal signes needs to be converted back and forth.. i think it is fixed in commit 60ec0f8

@Budman1758
Copy link
Author

Another bug seems to have been exterminated!!

@enesbcs
Copy link
Owner

enesbcs commented Feb 13, 2019

I am afraid there are some more hidden bugs.. But thanks, this one closed.

@enesbcs enesbcs closed this as completed Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting for feedback More details or tests needed
Projects
None yet
Development

No branches or pull requests

2 participants