I’m using PLEG to do a lot of my thermostat control in UI7 across multiple units, and it works great for that. I was having some issues however using templates to sent variables to VeraAlerts as a result of a Action in PLEG. All my temperature settings are set using lua variables, effectively the defaults are set in the startup Lua for PLEG, and variables are then updated as the result of various conditions. A single update condition then updates the thermostats with these variables. That all works.
The issue is I cant send these variables to VeraAlerts. The counter variables I set up as an input (to measure runtime), do work and I can send those thru to the VeraAlerts/Homewave with no isssue. Using the same construct, I cant get the variables to work. I presume its possible that the template isnt evaluated in a place where it has access to those variables, but when using the counter that is still local to PLEG.
The only thing I can think is that VeraAlerts is doing the template eval, and somehow the counter variable defined on the input pane is made global across all the modules? That seems a bit too risky to be the case. Either that or lua variables are visible to actions but somehow not to Veraalerts actions done via the GUI…
Vera Alert Templates only have access to variable accessible via luup.variable_get (i.e. all the variables that you can see in the advanced tab).
In PLEG you can use the advanced tab to send a Vera Alert SendAlert action .,.,. there you can use PLEG condition syntax to access a PLEG variable … i.e.:
{(SomePLEGVariableOrExpression)}
In the Message string for the Vera Alert’s plugin SendAlert Action.
First, thanks for a great plugin and all the value you bring to the Vera. Really makes some of the insanity tolerable =).
I will look at the lua based approach, but at the moment I am using the SendAlert Action in PLEG in two scenarios, only one of which works.
Working:
SendAlert: Daily AC use is: M{(MasterTime / 3600)}
Not Working:
SendAlert: MH:{(MasterHeat/1)} MC:{(MasterCool)}
MasterTime is a Counter defined as input in PLEG, MasterHeat/MasterCool are variables defined in the lua startup section and modified by various actions. The are defined and being used correctly by PLEG in both cases. The not working scenario basically just sends the text thru as entered into the GUI.
In PLEG actions only PLEG Input Variables and Conditions and Expressions are allowed via the syntax:
{(SomeInputConbditionOrExpression)}
In Vera Alert Templates ONLY Vera Device Variables (things you can do luup.variable_set and luup.variable_get) are accessible via the syntax:
{device([9].service[urn:upnp-org:serviceId:SwitchPower1].Status)}
Best Home Automation shopping experience. Shop at Ezlo!