Piston unable to subscribe to any events


#1

1) Give a description of the problem
I’ve created a piston to control the fan in my living room based on an Ecobee thermostat’s operating state, OR the temperature in the room. I want to set the fan speed to medium if the HVAC system is either cooling or heating. If neither is happening, I set it to speed based on temperature when there is motion in the room. When I start the piston I am getting the following error:

An error has occurred while subscribing: groovy.lang.MissingPropertyException: No such property: r for class: java.lang.Boolean

2) What is the expected behavior?
The piston should subscribe to events such as the thermostat operatingstate changing, motion, and temperature

3) What is happening/not happening?
I’m getting the error message mentioned above and the piston is not subscribing to any events.

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach any logs (From ST IDE and by turning logging level to Full)
10/17/2018, 11:30:05 AM +303ms
+1ms ╔Starting piston… (v0.3.108.20180906)
+570ms ║╔Subscribing to devices…
+575ms ║║An error has occurred while subscribing: groovy.lang.MissingPropertyException: No such property: r for class: java.lang.Boolean
+578ms ║╚Piston successfully started (577ms)


#2

Not sure if this is the best answer, but i had a similar issue a few weeks ago with 1 new piston i was working on. the only fix was creating an entirely new piston, and setting it up from scratch. for some reason the second time i created the piston allowed the subscriptions to be made properly.


#3

Another method for temperature ranges is to use case statements. Example can be found in the following thread:

You may also want to reconsider your use of the multiple Else blocks in your piston and instead just separate them into If blocks. I believe your first use is incorrect where you have:
Else if
Then
Else


#4

Thanks for the response. That Else if block used to have a condition there but then I removed it, yet the block remained. I’ve been having some issues adding conditions to this piston so I think it is corrupt in some way. I think my best bet is to recreate it using a better design. Thanks for the switch statement example, I will definitely utilize that.