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

Rule Trigger Analog0 possible? #2560

Closed
timtimsson opened this issue Apr 27, 2018 · 6 comments
Closed

Rule Trigger Analog0 possible? #2560

timtimsson opened this issue Apr 27, 2018 · 6 comments

Comments

@timtimsson
Copy link

Hello,
is a Trigger Analog0 possible?
Rule on Tele-Analog0<>=xxxx do publish xxxxx endon
Rule on Analog0<>=xxxx do publish xxxxx endon
Thanks!

@arendst
Copy link
Owner

arendst commented Apr 27, 2018

Give it a try and let us know

@timtimsson
Copy link
Author

tried out, unfortunately not possible...

@arendst
Copy link
Owner

arendst commented Apr 28, 2018

Was afraid it wouldn't work. Problem is the JSON message. Two solutions possible, I have to change the JSON message or invent code to detect difference between JSON single/second level message value.

I'll leave it for the moment...

@timtimsson
Copy link
Author

.. i would prefer this: :)))
xxx/tele/SENSOR {"Time":"2018-04-28T12:50:11","Switch1":"1","Analog0":{"A0":879},"BME280":{"Temperature":25.0,"Humidity":46.1,"Pressure":1000.4},"TempUnit":"C"}

I'll leave it for the moment
--> sure, i understand this!

arendst added a commit that referenced this issue Apr 28, 2018
5.12.0n
 * Change ESP8266 Analog JSON message from {"Analog0:123"} to
{"ANALOG":{"A0:123"}} to accomodate rules (#2560)
 * Change Counter JSON
message from {"Counter1":0,"Counter3":0} to {"COUNTER":{"C1":0,"C3":0}}
to accomodate rules
 * Change ADS1115 JSON message from
{"ADS1115":{"Analog0":123,"Analog1":123}} to
{"ADS1115":{"A0":123,"A1":123}}
@arendst
Copy link
Owner

arendst commented Apr 28, 2018

And then I couldn't leave it as it adds useful functionality.

Give it a go!

@timtimsson
Copy link
Author

... you are a very crazy guy! only a half day an the code is changed!
it works now perfectly with the new rules...

!Thank you for your fantastic work and the great tasmota!

curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 6, 2018
5.12.0n
 * Change ESP8266 Analog JSON message from {"Analog0:123"} to
{"ANALOG":{"A0:123"}} to accomodate rules (arendst#2560)
 * Change Counter JSON
message from {"Counter1":0,"Counter3":0} to {"COUNTER":{"C1":0,"C3":0}}
to accomodate rules
 * Change ADS1115 JSON message from
{"ADS1115":{"Analog0":123,"Analog1":123}} to
{"ADS1115":{"A0":123,"A1":123}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants