Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


peejayw

1714 posts

Uber Geek


#295823 26-Apr-2022 17:11
Send private message

I have a simple automation that I want to run during two time periods in the day, 5-7am and again at 5-9pm. I though maybe I could use the condition type of OR but that isnt working. The only other way I can think of is to use two automations, one for each time period but that seems very clunky, is there a better way? Thanks.





 I'm supposed to respect my elders, but it's getting harder and harder for me to find one now.


Create new topic
eonsim
262 posts

Ultimate Geek


  #2907047 26-Apr-2022 17:57
Send private message

Can't you simply add a second trigger?

 

There is a button in the GUI, or in yaml might look like this:

 

 

 

alias: Autmationname
description: ''
trigger:
  - platform: time
    at: '23:00:00'
  - platform: time
    at: '00:00:00'


 
 
 

Learn cloud, mobile, security, data and web technologies with Pluralsight (affiliate link).
peejayw

1714 posts

Uber Geek


  #2907051 26-Apr-2022 18:07
Send private message

The time isn't the trigger, its a condition. The trigger is a temperature being reached, the action is to turn on a fan but I only want it to happen during those two time periods, outside of those time periods I dont want the action to run. Hope that makes sense.





 I'm supposed to respect my elders, but it's getting harder and harder for me to find one now.


davidcole
5807 posts

Uber Geek

Trusted

  #2907054 26-Apr-2022 18:31
Send private message

Could use a time of day sensor. It’s just been added to the helpers ui. And it will set a Boolean for each time period.

So is MORNING was 0500-0700 and EVENING was 1700-2100 then during those time a Boolean for MORNING would be set, likewise the evening.

I use these (an idea I pulled from openHAB). And use it for controlling heating. Similar periods to you. I also define the 0700-1700 as DAY which is used for other things





Previously known as psycik

OpenHAB: Gigabyte AMD A8 BrixOpenHAB with Aeotech ZWave Controller, Raspberry PI, Wemos D1 Mini, Zwave, Xiaomi Humidity and Temperature sensors
Media:Chromecast v2, ATV4 4k, ATV4, HDHomeRun Dual
Windows 10
Host Plex Server 3x3TB, 4x4TB using DriveBender, Samsung 850 evo 512 GB SSD, Hyper-V Server with 1xW10, 2xUbuntu 20.04 LTS, Backblaze Backups, usenetprime.com




Ge0rge
1712 posts

Uber Geek

Trusted

  #2907055 26-Apr-2022 18:32
Send private message

I do things like that using the NodeRed add on. Very easy to create that sort of rule as a flow.

russelo
319 posts

Ultimate Geek


  #2907065 26-Apr-2022 19:01
Send private message

Use Node-red. Very easy for complex automations.

CrunchiePotatoes
9 posts

Wannabe Geek


  #2907068 26-Apr-2022 19:09
Send private message

As @davidcole said - create two "times of day" helpers - Can be created in the "helpers" tab next to automations.

 

Then you can easily add either of those helpers being true as conditions to your automation

 

 


peejayw

1714 posts

Uber Geek


  #2907086 26-Apr-2022 20:40
Send private message

Thanks everyone, looks like I need to learn about helpers next 😁




 I'm supposed to respect my elders, but it's getting harder and harder for me to find one now.




catdog
101 posts

Master Geek


  #2907110 26-Apr-2022 23:03
Send private message

peejayw:

The time isn't the trigger, its a condition. The trigger is a temperature being reached, the action is to turn on a fan but I only want it to happen during those two time periods, outside of those time periods I dont want the action to run. Hope that makes sense.



Can you post your (not working) automation?

An OR condition can work, but you need to be careful with how you set up the trigger.

If the temperature threshold is reached at say 4pm, then the automation will not start as expected. However, once it gets past 5pm then likely nothing will happen if the temperature remains above your threshold. The automation needs to be re-triggered again after 5pm to then re-evaluate the conditions before it can run.


davidcole
5807 posts

Uber Geek

Trusted

  #2907112 26-Apr-2022 23:28
Send private message

I have a controller automation that pretty much does this.  I stopped using it if favour of a thermostat entity and setting minimums.

 

you trigger off a temp change, the only run if morning, evening and temp threshold 





Previously known as psycik

OpenHAB: Gigabyte AMD A8 BrixOpenHAB with Aeotech ZWave Controller, Raspberry PI, Wemos D1 Mini, Zwave, Xiaomi Humidity and Temperature sensors
Media:Chromecast v2, ATV4 4k, ATV4, HDHomeRun Dual
Windows 10
Host Plex Server 3x3TB, 4x4TB using DriveBender, Samsung 850 evo 512 GB SSD, Hyper-V Server with 1xW10, 2xUbuntu 20.04 LTS, Backblaze Backups, usenetprime.com


eonsim
262 posts

Ultimate Geek


  #2907113 26-Apr-2022 23:40
Send private message

Using something like appDaemon also works well if you're happy to write real code.

 

Is what your aiming for something like the following?

 

 

 

If temperature changes and the time is ((between a and b) or (between c and d)) check to see how the temperature relates to a target and do something (cool or heat)?


davidcole
5807 posts

Uber Geek

Trusted

  #2907121 27-Apr-2022 06:38
Send private message

Another option is to use the simple thermostat.    And at morning and at evening set the thermostat target time to a temperature- eg 19)    And during the day, night (outside those periods) you set it lower eg 17

 

that’s the model I moved to.   But I made my own variant of the simple thermostat where you can also set a preset to boost which manually turns on the heating (or just whack up the temperature and the next time it enters the morning/evening time period it’s set back to my default of 19 degrees. 





Previously known as psycik

OpenHAB: Gigabyte AMD A8 BrixOpenHAB with Aeotech ZWave Controller, Raspberry PI, Wemos D1 Mini, Zwave, Xiaomi Humidity and Temperature sensors
Media:Chromecast v2, ATV4 4k, ATV4, HDHomeRun Dual
Windows 10
Host Plex Server 3x3TB, 4x4TB using DriveBender, Samsung 850 evo 512 GB SSD, Hyper-V Server with 1xW10, 2xUbuntu 20.04 LTS, Backblaze Backups, usenetprime.com


peejayw

1714 posts

Uber Geek


  #2907127 27-Apr-2022 07:46
Send private message

To explain what I am trying to do....

 

The room in question has a heat pump, a ceiling fan and two temperature sensors, one at ceiling height and one at floor level. With the help of members here I have made a template sensor that is the difference between the two temperatures, this is used in an automation to turn the ceiling fan on when the difference exceeds 1.5deg. Another automation turns the fan off when the difference drops below1deg. So far so good.

 

The heat pump is only turned on during the morning and evening time period mentioned and I dont want the fan turning on outside of this. I thought I could use OR conditions here but that doesn't seem to work. I would like to stick with using HA for this and preferably not get into Node Red.

 

This is the automation to date..

 

 

- id: '1649046539092'

 

  alias: Ceiling Fan On When Temp Diff above 1.5

 

  description: ''

 

  trigger:

 

  - platform: numeric_state

 

    entity_id: sensor.temperature_difference

 

    above: '1.5'

 

  condition:

 

  - condition: or

 

    conditions:

 

    - condition: time

 

      before: 08:30:00

 

      after: 05:30:00

 

    - condition: or

 

      conditions:

 

      - condition: time

 

        before: '21:00:00'

 

        after: '17:00:00'

 

  action:

 

  - service: switch.turn_on

 

    data: {}

 

    target:

 

      entity_id: switch.1000cc32f5

 

  mode: single

 

 

 

I will look into using Helpers as suggested, thanks.

 





 I'm supposed to respect my elders, but it's getting harder and harder for me to find one now.


davidcole
5807 posts

Uber Geek

Trusted

  #2907225 27-Apr-2022 10:43
Send private message

Might be better to push that into pastebin since geekzone doesn't have code formatting.

 

 





Previously known as psycik

OpenHAB: Gigabyte AMD A8 BrixOpenHAB with Aeotech ZWave Controller, Raspberry PI, Wemos D1 Mini, Zwave, Xiaomi Humidity and Temperature sensors
Media:Chromecast v2, ATV4 4k, ATV4, HDHomeRun Dual
Windows 10
Host Plex Server 3x3TB, 4x4TB using DriveBender, Samsung 850 evo 512 GB SSD, Hyper-V Server with 1xW10, 2xUbuntu 20.04 LTS, Backblaze Backups, usenetprime.com


Create new topic





News and reviews »

New Air Traffic Management Platform and Resilient Buildings a Milestone for Airways
Posted 6-Dec-2023 05:00


Logitech G Launches New Flagship Console Wireless Gaming Headset Astro A50 X
Posted 5-Dec-2023 21:00


NordVPN Helps Users Protect Themselves From Vulnerable Apps
Posted 5-Dec-2023 14:27


First-of-its-Kind Flight Trials Integrate Uncrewed Aircraft Into Controlled Airspace
Posted 5-Dec-2023 13:59


Prodigi Technology Services Announces Strategic Acquisition of Conex
Posted 4-Dec-2023 09:33


Samsung Announces Galaxy AI
Posted 28-Nov-2023 14:48


Epson Launches EH-LS650 Ultra Short Throw Smart Streaming Laser Projector
Posted 28-Nov-2023 14:38


Fitbit Charge 6 Review 
Posted 27-Nov-2023 16:21


Cisco Launches New Research Highlighting Gap in Preparedness for AI
Posted 23-Nov-2023 15:50


Seagate Takes Block Storage System to New Heights Reaching 2.5 PB
Posted 23-Nov-2023 15:45


Seagate Nytro 4350 NVMe SSD Delivers Consistent Application Performance and High QoS to Data Centers
Posted 23-Nov-2023 15:38


Amazon Fire TV Stick 4k Max (2nd Generation) Review
Posted 14-Nov-2023 16:17


Over half of New Zealand adults surveyed concerned about AI shopping scams
Posted 3-Nov-2023 10:42


Super Mario Bros. Wonder Launches on Nintendo Switch
Posted 24-Oct-2023 10:56


Google Releases Nest WiFi Pro in New Zealand
Posted 24-Oct-2023 10:18









Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.







NordVPN