Power Arithmetic plugin

That should work. Does it still fail even if the formula is really simple, like [tt]power(id1)[/tt] or even just [tt]42[/tt]?

(You are using the Vera device ID and not the Z-Wave device number, yes?)

Probably you’ll need to capture a Luup log of the plugin starting up.

Futzle, I really like this plugin and the work you did on it. I have a question for you. I’m trying to create an event that fires when the wattage drops below 0.5 watts. This is not triggering even though the resolution of the wattage is down to a thousandth of a watt.

If I set it to trigger when wattage drops below 1 watt, it works. Doesn’t seem to be able to handle 0 < n < 1 values.

Is there a way I can accomplish this?

[quote=“Sarnak”]I’m trying to create an event that fires when the wattage drops below 0.5 watts. […]
Is there a way I can accomplish this?[/quote]

Not purely with the Power Arithmetic plugin, no. The problem is that Vera’s built-in scene trigger code only works on integers, so if you try to say 0.5 you are really just saying 0. There’s a similar shortcoming in the Heliotrope plugin, and presumably any other plugin that creates devices with scene triggers.

You might be able to continue to do the arithmetic with the plugin, but you’ll have to trigger the scene with your own code. I’m not sure if luup.variable_watch() will operate on floating-point values. Try it and see.

It must do, since all device variables are actually strings.

It doesnt seem to like “if” strings in ui7 that used to work fine in ui5, ie power(90) >= 200 ? power(90) : 0 , any pointers or syntax changes that could get it working again?

Interesting. Looks like in UI7 when you edit the formula you have to turn on the checkbox “switch to input type text” (sic) or Vera converts the [tt]>[/tt] character to [tt]>[/tt].

I always wondered what the heck that checkbox did.

Yes, that was their ‘fix’ for bits of HTML being inserted randomly… worst interface ever.