Hello @roschi,
Sorry for the delay to answer, little busy.
Thanks for the answer. I’ll follow your suggestion.
@radar Maybe you want to show your result?
After reading over my last post again, I noticed it sounded a bit rude, what wasn’t my intention, and part of that came from an unfortunate translation. What I actually wanted to say is that the schedule you posted shows that you didn’t fully understand how rules are evaluated and I didn’t have the time to walk through it with you line by line right now.
Did the examples I referred to help you better understanding the evaluation flow?
@roschi, really no problem, did not feel it rude at all.
I have to admit that I (already) know that I have not fully understood how the rules are evaluated and that I’m iterating with the different possibilities until having something that works. To be honest, I tried to read the doc, not further than few days ago before posting my question, and I got lost, somewhere, I don’t know where.
Did the examples I referred to help you better understanding the evaluation flow?
Did not yet have time to look to it. I’ll keep you informed.
Thanks again for your help.
Ok, if you have concrete suggestions for improving the docs, let me know. I know they can sometimes be hard to follow, especially the chapters marked as advanced, but I think this is mainly due to the fact that Schedy gives you that much power in writing schedules. Not to say there’s no room for improvement regarding the docs.
Hi all,
Here we go - Schedy 0.4.0 is out!
This release mostly brings some enhancements for advanced users, but also a fix for an annoying bug with watched entities. The changelog is below. Have fun!
Fixed
- Fixed name of
value_parameter
setting for generic actor in docs. - Schedules were re-evaluated when the value of a not watched attribute
of a watched entity changes.
Added
- Added new result marker
OVERLAY_REVERT_ON_NO_RESULT
to cancel an
overlay when the schedule produces no result. - Result markers can now be added by postprocessors as well.
- The generic actor has received new features (short values and sending of attributes in reversed order). See the actor sample config for details.
Changed
- The wanted value of a room is not sent to actors at startup when
replicate_changes
has been disabled in the room’s configuration.
Removed
- The old name
schedy_reschedule
for theschedy_reevaluate
event has been removed.
@roschi Thanks for your work on Schedy. I love it and it has replaced all my scheduling automations. Love it !
@Nicolas_B You’re very welcome, thanks a lot for your appreciation, and if you’ve got feedback, just tell me via GitHub issue.
Hi,
I had to do a reinstal and now when I try to run Schedy I get the following error:
[cont-init.d] 50-compiled-symlink.sh: executing... [cont-init.d] 50-compiled-symlink.sh: exited 0. [cont-init.d] 80-system-packages.sh: executing... [cont-init.d] 80-system-packages.sh: exited 0. [cont-init.d] 81-python-packages.sh: executing... Collecting hass-apps Downloading https://files.pythonhosted.org/packages/7b/c9/c0a4a7663e6c5a77212b5771744504523e981147b72cd525cc2bcb27ed5b/hass_apps-0.20190224.0-py3-none-any.whl (77kB) Collecting observable>=1.0 (from hass-apps) Downloading https://files.pythonhosted.org/packages/45/7c/b4b63f447378e8a0ebcd338d90f9389f57fb23253127425beacf0129edcb/observable-1.0.3-py2.py3-none-any.whl Requirement already satisfied: appdaemon>=3.0 in /usr/lib/python3.6/site-packages (from hass-apps) (3.0.2) Requirement already satisfied: voluptuous>=0.11 in /usr/lib/python3.6/site-packages (from hass-apps) (0.11.5) Requirement already satisfied: paho-mqtt in /usr/lib/python3.6/site-packages (from appdaemon>=3.0->hass-apps) (1.4.0) Requirement already satisfied: iso8601 in /usr/lib/python3.6/site-packages (from appdaemon>=3.0->hass-apps) (0.1.12) Requirement already satisfied: aiohttp-jinja2==0.15.0 in /usr/lib/python3.6/site-packages (from appdaemon>=3.0->hass-apps) (0.15.0) Requirement already satisfied: daemonize in /usr/lib/python3.6/site-packages (from appdaemon>=3.0->hass-apps) (2.4.7) Requirement already satisfied: bcrypt in /usr/lib/python3.6/site-packages (from appdaemon>=3.0->hass-apps) (3.1.4) Requirement already satisfied: astral in /usr/lib/python3.6/site-packages (from appdaemon>=3.0->hass-apps) (1.7.1) Requirement already satisfied: sseclient in /usr/lib/python3.6/site-packages (from appdaemon>=3.0->hass-apps) (0.0.19) Requirement already satisfied: yarl==1.1.0 in /usr/lib/python3.6/site-packages (from appdaemon>=3.0->hass-apps) (1.1.0) Requirement already satisfied: websocket-client in /usr/lib/python3.6/site-packages (from appdaemon>=3.0->hass-apps) (0.54.0) Requirement already satisfied: feedparser in /usr/lib/python3.6/site-packages (from appdaemon>=3.0->hass-apps) (5.2.1) Requirement already satisfied: Jinja2==2.10 in /usr/lib/python3.6/site-packages (from appdaemon>=3.0->hass-apps) (2.10) Requirement already satisfied: aiohttp==2.3.10 in /usr/lib/python3.6/site-packages (from appdaemon>=3.0->hass-apps) (2.3.10) Requirement already satisfied: pyyaml in /usr/lib/python3.6/site-packages (from appdaemon>=3.0->hass-apps) (3.13) Requirement already satisfied: requests>=2.6.0 in /usr/lib/python3.6/site-packages (from appdaemon>=3.0->hass-apps) (2.20.0) Requirement already satisfied: cffi>=1.1 in /usr/lib/python3.6/site-packages (from bcrypt->appdaemon>=3.0->hass-apps) (1.11.5) Requirement already satisfied: six>=1.4.1 in /usr/lib/python3.6/site-packages (from bcrypt->appdaemon>=3.0->hass-apps) (1.11.0) Requirement already satisfied: pytz in /usr/lib/python3.6/site-packages (from astral->appdaemon>=3.0->hass-apps) (2018.7) Requirement already satisfied: multidict>=4.0 in /usr/lib/python3.6/site-packages (from yarl==1.1.0->appdaemon>=3.0->hass-apps) (4.4.2) Requirement already satisfied: idna>=2.0 in /usr/lib/python3.6/site-packages (from yarl==1.1.0->appdaemon>=3.0->hass-apps) (2.7) Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib/python3.6/site-packages (from Jinja2==2.10->appdaemon>=3.0->hass-apps) (1.0) Requirement already satisfied: chardet in /usr/lib/python3.6/site-packages (from aiohttp==2.3.10->appdaemon>=3.0->hass-apps) (3.0.4) Requirement already satisfied: async_timeout>=1.2.0 in /usr/lib/python3.6/site-packages (from aiohttp==2.3.10->appdaemon>=3.0->hass-apps) (3.0.1) Requirement already satisfied: idna-ssl>=1.0.0 in /usr/lib/python3.6/site-packages (from aiohttp==2.3.10->appdaemon>=3.0->hass-apps) (1.1.0) Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3.6/site-packages (from requests>=2.6.0->appdaemon>=3.0->hass-apps) (2018.10.15) Requirement already satisfied: urllib3<1.25,>=1.21.1 in /usr/lib/python3.6/site-packages (from requests>=2.6.0->appdaemon>=3.0->hass-apps) (1.24) Requirement already satisfied: pycparser in /usr/lib/python3.6/site-packages (from cffi>=1.1->bcrypt->appdaemon>=3.0->hass-apps) (2.19) Installing collected packages: observable, hass-apps Successfully installed hass-apps-0.20190224.0 observable-1.0.3 You are using pip version 10.0.1, however version 19.0.3 is available. You should consider upgrading via the 'pip install --upgrade pip' command. [cont-init.d] 81-python-packages.sh: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. 2019-02-27 12:16:14.558148 INFO AppDaemon Version 3.0.2 starting 2019-02-27 12:16:14.559390 INFO Configuration read from: /config/appdaemon/appdaemon.yaml 2019-02-27 12:16:14.564610 INFO AppDaemon: Starting Apps 2019-02-27 12:16:14.574708 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin 2019-02-27 12:16:14.822718 INFO AppDaemon: HASS: HASS Plugin Initializing 2019-02-27 12:16:14.824642 INFO AppDaemon: HASS: HASS Plugin initialization complete 2019-02-27 12:16:14.826324 INFO Starting Dashboards 2019-02-27 12:16:14.846490 INFO API is disabled 2019-02-27 12:16:14.864399 INFO AppDaemon: HASS: Connected to Home Assistant 0.88.1 2019-02-27 12:16:15.427027 INFO AppDaemon: Got initial state from namespace default 2019-02-27 12:16:17.082501 INFO AppDaemon: Reading config 2019-02-27 12:16:17.184499 INFO AppDaemon: /config/appdaemon/apps/apps.yaml added or modified 2019-02-27 12:16:17.185099 INFO AppDaemon: /config/appdaemon/apps/apps.yaml added or modified 2019-02-27 12:16:17.185806 INFO AppDaemon: App 'hello_world' added 2019-02-27 12:16:17.186531 INFO AppDaemon: App 'schedy_verwarming' added 2019-02-27 12:16:17.187574 INFO AppDaemon: Adding /config/appdaemon/apps to module import path 2019-02-27 12:16:17.189254 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/hello.py 2019-02-27 12:16:17.220388 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello 2019-02-27 12:16:17.486057 INFO hello_world: Hello from AppDaemon 2019-02-27 12:16:17.490399 INFO hello_world: You are now ready to run Apps! 2019-02-27 12:16:17.491273 INFO AppDaemon: Initializing app schedy_verwarming using class SchedyApp from module hass_apps_loader 2019-02-27 12:16:17.492040 WARNING AppDaemon: Unable to find module module hass_apps_loader - schedy_verwarming is not initialized 2019-02-27 12:16:17.494299 INFO AppDaemon: App initialization complete 2019-02-27 12:19:41.190452 INFO AppDaemon: Reading config 2019-02-27 12:19:41.298940 INFO AppDaemon: /config/appdaemon/apps/apps.yaml added or modified 2019-02-27 12:19:41.299580 INFO AppDaemon: App 'schedy_verwarming' deleted 2019-02-27 12:19:41.300753 INFO AppDaemon: App 'schedy' added 2019-02-27 12:19:41.302315 INFO AppDaemon: Initializing app schedy using class SchedyApp from module hass_apps_loader 2019-02-27 12:19:41.303039 WARNING AppDaemon: Unable to find module module hass_apps_loader - schedy is not initialized 2019-02-27 12:22:32.116624 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds 2019-02-27 12:22:37.133047 INFO AppDaemon: HASS: Connected to Home Assistant 0.88.1 2019-02-27 12:22:37.151184 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds 2019-02-27 12:22:42.167662 INFO AppDaemon: HASS: Connected to Home Assistant 0.88.1 2019-02-27 12:22:42.184069 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds 2019-02-27 12:22:47.200440 INFO AppDaemon: HASS: Connected to Home Assistant 0.88.1 2019-02-27 12:22:47.217387 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds 2019-02-27 12:22:52.239579 INFO AppDaemon: HASS: Connected to Home Assistant 0.88.1 2019-02-27 12:22:52.254734 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds 2019-02-27 12:22:57.281698 INFO AppDaemon: HASS: Connected to Home Assistant 0.88.1 2019-02-27 12:22:57.295345 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds 2019-02-27 12:23:02.322739 INFO AppDaemon: HASS: Connected to Home Assistant 0.88.1 2019-02-27 12:23:02.337294 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds 2019-02-27 12:23:07.365032 INFO AppDaemon: HASS: Connected to Home Assistant 0.88.1 2019-02-27 12:23:07.383781 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds 2019-02-27 12:23:12.411439 INFO AppDaemon: HASS: Connected to Home Assistant 0.88.1 2019-02-27 12:23:12.426599 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds 2019-02-27 12:23:17.444510 INFO AppDaemon: HASS: Connected to Home Assistant 0.88.1 2019-02-27 12:23:19.221889 INFO AppDaemon: Processing restart for HASS 2019-02-27 12:23:19.222809 INFO AppDaemon: Terminating hello_world 2019-02-27 12:23:19.224040 INFO AppDaemon: Terminating schedy 2019-02-27 12:23:19.225332 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello 2019-02-27 12:23:19.230238 INFO hello_world: Hello from AppDaemon 2019-02-27 12:23:19.235114 INFO hello_world: You are now ready to run Apps! 2019-02-27 12:23:19.235823 INFO AppDaemon: Initializing app schedy using class SchedyApp from module hass_apps_loader 2019-02-27 12:23:19.236617 WARNING AppDaemon: Unable to find module module hass_apps_loader - schedy is not initialized
Hass apps appeared to be installed correctly and im still using the same config as before:
---
hello_world:
module: hello
class: HelloWorld
schedy:
module: hass_apps_loader
class: SchedyApp
actor_type: thermostat
actor_templates:
default:
supports_opmodes: false
rooms:
slaapkamer_links:
allow_manual_changes: true
rescheduling_delay: 90
actors:
climate.slaapkamer_links:
schedule:
- value: 16
rules:
- weekdays: "1-5"
rules:
- { start: "21:00", end: "8:00" }
- weekdays: "6, 7"
rules:
- { start: "22:00", end: "9:00" }
- value: 4
slaapkamer_rechts:
allow_manual_changes: true
rescheduling_delay: 90
actors:
climate.slaapkamer_rechts:
schedule:
- value: 16
rules:
- weekdays: "1-5"
rules:
- { start: "21:00", end: "23:00" }
- weekdays: "6, 7"
rules:
- { start: "22:00", end: "0:00" }
- value: 4
gang:
allow_manual_changes: true
rescheduling_delay: 90
actors:
climate.gang:
schedule:
- value: 19
rules:
- weekdays: "1-5"
rules:
- { start: "7:00", end: "23:00" }
- weekdays: "6, 7"
rules:
- { start: "8:00", end: "00:00" }
- value: 15
{
“log_level”: “info”,
“system_packages”: ,
“python_packages”: [
“hass-apps”
]
}
What am I missing here?
@Jules_Bousema The error message sais it quite well: You didn’t place hass_apps_loader.py
in your apps directory.
Figured it out just 2 seconds ago. I stopped reading after the installation part in the docs. Sorry to waste your time…
Hello Everybody,
I’m stuck with my first trial to use Shedy. Could someone of you have a look on my code. There must be something wrong, but I cannot see it . I have a guess but I will come back to that thought later in this post.
I have the following code in the schedule section of a room in the shedy configuration:
schedule:
# if room switch is off disable heating
- x: "8 if is_off('input_boolean.heating_switch_living_room') else Skip()"
# set schedule based on time date input and target temperature slider
- x: |
target = state('input_number.heating_living_room_target_temperatur')
start = state('input_datetime.heating_living_room_start_time')
end = state('input_datetime.heating_living_room_end_time')
today = datetime.date.today()
start = datetime.datetime.strptime(start,"%H:%M:%S")
start = datetime.datetime.combine(today, start.time())
end = datetime.datetime.strptime(end,"%H:%M:%S")
end = datetime.datetime.combine(today, end.time())
x = datetime.datetime.combine(today, time)
if end <= start: end += datetime.timedelta(1)
if x <= start: x += datetime.timedelta(1)
time_in_range = start <= x <= end
result = target if time_in_range else Skip()
# if no rule applies set temperature to 8
- v: 8
As you can see I have two input_datetime, one input_number and one input_boolean from the configuration.yaml. With that I want to configure Shedy from the frontend. The python code is basically checking if the current time is between start and end time, and if this is the case setting the temperature for this room to the target (it looks a bit complicated but it should be able to cover end < start like between 20:00 and 6:00).
all inputs are in the watched list:
watched_entities:
- "input_boolean.heating_switch_living_room"
- "input_number.heating_living_room_target_temperatur"
- "input_datetime.heating_living_room_start_time"
- "input_datetime.heating_living_room_end_time"
The problem is now that when the current time crosses start or end the rule is not evaluated and the temperature stays the same as before. When using the input_boolean to turn off and on again the heating, the rule gets reevaIuated and the result is correct (at least I think its correct). I guess the reason is that there is no trigger like the change of one of the watched entities. What would be the best way to do so? Do I need to add in HA an automation which triggers a reevaluation whenever the current time is start or end?
Every help is highly appreciated. Thanks a lot in advance.
Didn’t read the documentation properly :-
" schedy_reevaluate
: Trigger a re-evaluation of schedules. Only use this event if you can’t express the criteria that should trigger a re-evaluation via the watched_entities
configuration, e.g. when you need re-evaluation.based on time intervals instead of state changes."
With that I will make it. Thanks for your great work creating Shedy.
How can I write a schedule that incorporates sunrise / sunset? I currently use a combination of an automation and schedy to switch the light.
I also need to experiment on using a season setting to vary the offset from sunrise /sunset.
Hi,
Was quite busy during the last weeks.
@baz123 There is no native support for sunset start/end triggers in Schedy at the moment. However, you can access the sun.sun
entity of HA and all its attributes from your schedule rule. Or you create a template binary_sensor
which is on when your rule should be active and query that in the schedule rule expression.
This approach I cannot do offset to sunset, as 1 hour before sunset on specific day
of course you can.
i got template sensors that have an offset from 1 hour for ages now.
this shows the time 1 hour before sunset (i use that on a dashboard)
sensors:
- platform: template
sensors:
livingroom_lights:
friendly_name: Lights go on
value_template: '{%- if states.sun.sun -%}{{ ((as_timestamp(states.sun.sun.attributes.next_setting)-(60*60)) | timestamp_local)[11:16] }}{%- else -%}{{"0:00"}}{%- endif -%}'
entity_id:
- sun.sun
you can let that show the complete time, or create a binary template from that and use that to turn things on.
Hi
I’m using Schedy to control some heating components through home assistant using hass.io and I’m based in the UK. Since the end of march we’ve been in British Summer Time but Schedy still seems to be running from times in UTC.
When I look at HA and AppDaemon it looks like they are both correctly picking up and applying the timezone settings. (time_zone in the config and I’ve tried to update both).
If I add a clock component on an AppDaemon Dashboard it’s got the correct local time.
The Log for appdaemon is in UTC but even logging at debug level I can’t see anything mentioning timezones.
2019-05-31 22:24:56.996920 DEBUG schedy: — [R:schedule] Assuming it to be 2019-05-31 22:24:56.
Does Schedy support scheduling in local time and summer time changes?
Thanks
Peter
Hi Pete,
I am using Schedy since December last year and switching to the DST in the Netherlands was fine so I am afraid it is something with your installation. I am no Python expert so can not help you with further debugging.
Marc
Hi,
AppDaemon takes over the timezone of the host when /etc/localtime
is mapped into its Docker container. I don’t know how hassio handles this, but when AD’s log isn’t in local time that means it didn’t pick up the right timezone. Maybe @ReneTode can help you out there? He is more familiar with AppDaemon on hassio I think.
Best regards
Robert