I would like to use my Aeon Labs Home Energy Meter to switch on a AN157 On/Off m

I would like to use my Aeon Labs Home Energy Meter to switch on a AN157 On/Off module when the Watts reach a set level?
I’ve been looking for 2 days for luup coding that I can use but can’t find anything for watt output to switch on the AN157
Keith

Keith, you could use the Combination Switch plugin to watch the power consumption that your energy monitor reports. You could then create a scene that is triggered by the Combination Switch changing state, and which activates your device.

Edit: spelling

Sorry new to this only had the kit for two days, I tried the install app Combination Switch plug-in although it looked like it would do the job I couldn’t get it to work with Aeon Labs Home Energy Meter. It worked with theAN157 On/Off module OK
Keith

Keith, if you could go over to the support thread for the Combination Switch plugin and post a reply saying what you are doing and how it isn’t working, I can look at why.

Thanks got the Combination Switch to switch on when Watts reach a set level. Now having a problem written a Luup Scenes Events to work when the Combination Switch see the correct set level and turn on the AN157. I scheduled a scene to run every minute as below but this will not turn on the AN157

[code]local lul_tmp = luup.variable_get(“urn:schemas-futzle-com:device:CombinationSwitch:1”, “Status”, 15) – Combination Switch
if (lul_tmp == “1”) then
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”, “SetTarget”, {newTargetValue = “1”}, 13) – AN157

end[/code]

You shouldn’t need Luup at all for this.

Make a new scene. On the Triggers page, add a trigger: Combination Switch > Virtual Switch Status Changes > Switch Turns On. On the Devices page, make it turn your AN517 on. Confirm changes, and save.

For what it’s worth, your Luup uses a wrong string—you’ve used a service type on the Combination Switch where you should have used a service id—so it would always have tested false.

Thanks for all you help it all been most useful.
The below worked OK I need also away that the Combination Switch will also turn off the AN517 when set level falls, I have played with setting but seem unable to do this.

Make a new scene. On the Triggers page, add a trigger: Combination Switch > Virtual Switch Status Changes > Switch Turns On. On the Devices page, make it turn your AN517 on. Confirm changes, and save.

Make a second Combination Switch and a second scene for the turning-off bit.

(Making extra plugin devices is hard to find. Here’s how)

Sorry I already tried that and was unable to get it to work, had a break and had another ago and thanks it works. Can I call on you again if I have problems saves spending time going down the wrong route? Keith

If you have a problem, post it to the forum. I’ll help if I can, if I have time. I’m just a user like you; I just happen to have been here for longer.

I have a problem that need to be solved it is a stage further then what we have been working on.
I have a 10KW solar which is connecting to the Aeon Labs Home Energy Meter port 2.
The mains are connected to port 1.
What we have done with the Combination Switch works ok with one AN157, i.e. when the solar is working at a level turn on AN157 and turn off when not. What I would like to do, is have a rule that works firstly when the solar is generating, but also look at the Aeon Labs Home Energy Meter the mains connected port 1 to see if this at 0 watts if so then carry on powering the AN157. What do you think?

Yeah, I think that the Combination Switch can do that. You’d have two conditions: Port 2 in range (n to ∞); Port 1 in range (-∞ to 0). Set the Combination Switch to turn on when 1 or more conditions are true.

Experiment and I bet you can get the combination that you need. Stick with two Combination Switches, one to turn the AN157 on, one to turn it off. Don’t make the conditions exact mirror images of each other; leave a little room for hysteresis.

Thanks again all good news, working fine