At line 88 in you piston posted above, you have an empty On statement. You should remove that as that is what is causing the issue (and you are not using it).
Sorry I don't understand how to fix this. This worked great on ST and I only did an import of the old working piston. Around line 88 is the other part of the if statement. Does HE webCoRE work differently on HE vs ST?
I understand that it is blank, but that is the other side of the original if statement. Above, I am checking IF either device presence is not present, this is the other part of the IF to check that the 2 devices are present.
I posted an update that should fix this (without the edit I described, which itself is a bug in your piston). HPM repair would get it if you want to try it out.
I was able to get the piston to work. Now I just having the same issues other are with the iOS notifications and HE...
I can test the presence manually in the device via HE, so I know the piston works as I need it. Hopefully the presence issues are also resolved some day.