Page 1 of 1

Virtual switch not used in night (cheap) energy setup

Posted: Saturday 22 April 2017 13:58
by harolds
I have setup a blockly that should make it possible to use devices only during nights. I use it to charge my electric bike. But I don't want to enable it every night because its not needed. Then the charger would try to charge my bike every night and thats resulting in extra power usage (thus costs).

The idea is that I switch the virtual switch during the day and that my bike gets charged after 23:00 (or during the weekend). At 7:00 in the morning the power outlet is switched to 'off' and the virtual switch is also switched to 'off'.

The problem is that even when the virtual switch is 'off' the power outlet still get switched on every day at 23:00. If looks a bit like this is a bug. I am running the latest beta release (need it to be able to use the CurrentCost power monitoring device).

This is the blockly.

Re: Virtual switch not used in night (cheap) energy setup

Posted: Monday 24 April 2017 1:35
by sion
Hi.
First up, having nested if statements in blocky will cause problems. You need to restructure or use Lua. However, with a second virtual switch and timers, this becomes very simple.

Let's call your existing virtual switch x.
And make a new. Ritual switch called y.

Set timer on x to turn it off at 7.00

Set timer on y - on at 23.00 and off at 7.00.
You can specify days if you want to have it on all day on weekends.

Now blocky just needs to be.

If x = on and y=on
Set power plugs =on

Else if y= off
Set power plugs = off.

Hope that helps.