This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.
Flows HomeyScript

Newbie question about multiple 'or' clauses in a flow

manrotmanrot Member
edited March 2018 in Questions & Help
Hi as stated in the title I am a newbie.
Even so new I do not have an Homey  :o

But I am very interested in buying one, to solve my central heating issue at home.

The situation:
  • I have 4 temperature sensors installed in different rooms.
  • I have 3 radiator valves to controle heating radiators. (bathroom, office, livingroom, kitchen)
  • I have 1 220V switch to control the pump of the floor heating.of the living room
  • I have 1 220V switch to control the central pump of my Central Heating unit which is installed in the attick.
Currently I use a system called FHT (bought at Conrad) to control all of this, and it is/was working fine, untill one of the units broke down. It is hard to get any replacements, but I also would like to switch to Homey to control it using an app
examples of the devices.
As far as I know Homey does not support these devices, So I have to buy new devices, which are supported by Homey.
  • FHZ1000 Thermostat radiographic central
  • FHT80B-2 Thermostat
  • FS20 ST3 220 switch
  • FHT 8W IP65 heathrelais
  • FS20 Radiator valve

Question:
  • Is it possible to create a flow (depending on day and time) to turn on my central heating pump when one of the thermostats signals the temperature is lower than an limit?
  • and of course turn it of when all temperatures are above a limit?
  • it should be possible to override the schedule by pushing a button (just turn on the heating)
  • it should be possible to override the schedule by pushing a button (just turn off the heating) 
Here is a kind of javascript pseudo code:

if ((day == weekday) && (time > 16:00)  && (time < 23:00)){
    if ((temp-livingroom < 21) ||
         (temp-bathroom <21) ||
         (temp-office < 21) ||
         (temp-kitchen < 21)){
           turn on switch_for_central_valve
    } else {
      turn off switch_for_central_valve
    }
} else { 
    if ((day == weekend) && (time > 08:30) && (time < 23:30)){
      if ((temp-livingroom < 21) ||
           (temp-bathroom <21) ||
           (temp-office < 21) ||
           (temp-kitchen < 21)){
              turn on switch_for_central_valve
           } else {
              turn off switch_for_central_valve
           }
    } else { 
         turn off switch_for_central_valve
    }
}

Off course parallel to this flow there should be a flow to control the valve of each room
if ((day == weekday) && (time > 16:00)  && (time < 23:00)){
    if ((temp-livingroom < 21) { turn on valve_livingroom} else { turn off valve_livingroom }
    if ((temp-bathroom < 21) { turn on valve_bathroom} else { turn off valve_bathroom}
    ... etc
 } else { 
    if ((day == weekend) && (time > 08:30) && (time < 23:30)){
    if ((temp-livingroom < 21) { turn on valve_livingroom} else { turn off valve_livingroom }
    if ((temp-bathroom < 21) { turn on valve_bathroom} else { turn off valve_bathroom}
    ... etc
} else {
   turn off valve_livingroom
   turn off valve_bathroom
   .... etc.
}
Tagged:
Sign In or Register to comment.