Hello,
I'm tring to manage my heating with logics.
I try this but the scheduler didn t seem to work :
Is it possible to schedule a logics several times ?
Thanks a lot
I'm tring to manage my heating with logics.
I try this but the scheduler didn t seem to work :
Code:
from datetime import date, datetime
programmes = {
'P1': ['6h30','7h45','16h00','22h45'],
'P2': ['7h30','23h30']
}
zones = {
'Z1': ['salon','sam','cuisine'],
'Z2': ['chenfant','chparents']
}
sched = [
# LMMJVSDCAbs day of week + holidays => day mode on when * present else night mode
('-----***-', 'Z1', 'P1'),
('*----***-', 'Z2', 'P1')
]
# Gestion du jour
jour = date.today().weekday()
if sh.system.conges:
jour = 7
if sh.system.absence:
jour = 8
# Parcours du sched
for cron, zone, prog in sched:
if cron[jour] == '*':
# On applique le planing a la zone
status = True
for hour in programmes[prog]:
for room in zones[zone] :
h, m = map(int, hour.split('h'))
dt = sh.now().replace(hour = h, minute = m)
logger.info("***" +str(dt) +"***")
sh.trigger('ItemChange', value=(room +".temp.journuit", status), dt=dt)
status = not status
Thanks a lot


:
Kommentar