Virtual switch not used in night (cheap) energy setup

Moderator: leecollings

Post Reply
harolds
Posts: 12
Joined: Saturday 22 April 2017 13:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Virtual switch not used in night (cheap) energy setup

Post 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.
Attachments
Snap 2017-04-22 at 13.57.27.png
Snap 2017-04-22 at 13.57.27.png (50.19 KiB) Viewed 864 times
sion
Posts: 113
Joined: Friday 08 January 2016 12:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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.
running domoticz 3.4834 on rpi2, with
Hue bridge / bulbs.
lightwave rf sockets, mood controlers, sensors & contacts.
Home bridge / Siri.
Ha bridge / echo Alexa.
Hard wired alarm system - setting home / away status.

Next: harmony hub.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest