Need help with simple task

Moderator: leecollings

Post Reply
User avatar
slowdowndave
Posts: 1
Joined: Wednesday 24 February 2016 16:39
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: Ontario, CAN
Contact:

Need help with simple task

Post by slowdowndave »

This is my first attempt at using blockly for what seems like it should be a simple task. I want to turn a fan on for 5 minutes every hour or half hour if the humidity is above 50%. I'm not exactly sure how Blockly works but I assume it follows through each line and then starts back at the beginning. Here's what I have.
Screenshot_20170207-071212.png
Screenshot_20170207-071212.png (19.75 KiB) Viewed 568 times
This what is happening, the fan comes on for 5 minutes and then off for 2.5 minutes.
Screenshot_20170207-071235.png
Screenshot_20170207-071235.png (50.94 KiB) Viewed 568 times
User avatar
K3rryBlue
Posts: 77
Joined: Tuesday 07 February 2017 22:13
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10xx
Location: Netherlands
Contact:

Re: Need help with simple task

Post by K3rryBlue »

You need to add a ELSEIF to the Blocky, now you running in loops.
The lowest value you can reach is 50% and that causes the blocky to keep repeating itself.
Your last step 5 minutes only last the cycle time of the blockly statement (I believe every 30 seconds)

Always remember that if you switch via Blockly, you create a step to exit the statement, as Blockly run in a loop.

Code: Select all

rh = current value

IF rh >= 50
  DO turn FAN on 5 min
ELSEIF rh < 50
  DO turn FAN off 30 min
Domoticz V4.10717, RPi2 -> Linux raspberrypi 4.4.47-v7+ , RFXCOM - RFXtrx433 USB 433.92MHz ,RAZBERRY2 and OpenZWave USB Version: 1.4-2363-g1f10253-dirty
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest