2018-06-15 20:58:29 WARNING (MainThread) [homeassistant.core] Unable to find service sensor/turn_off
To me, it appears that the appdaemon call references a sensor domain rather than an alarm domain when the call is made. Is this something I’m doing wrong?
Thanks for the reply. I didn’t know that there was a dedicated appdaemon category. I don’t see it in the pull-down list. How do I transfer this topic over there?
In the meantime, here is the bulk of the script where I’m having problems:
import appdaemon.plugins.hass.hassapi as hass
import datetime
upstairs_sleeping_temp = 72
upstairs_waking_temp = 73
downstairs_sleeping_temp = 75
downstairs_waking_temp = 74
class Scenes(hass.Hass):
def initialize(self):
self.listen_event(self.scene_activated, event='call_service', domain='scene', service='turn_on')
def scene_activated(self, event_name, data, kwargs):
if data['service'] == 'turn_on':
# A scene was activated; check to see which one
if data['service_data']['entity_id'] == 'scene.bedtime':
self.bedtime()
elif data['service_data']['entity_id'] == 'scene.good_night':
self.good_night()
elif data['service_data']['entity_id'] == 'scene.good_morning':
self.good_morning()
else:
self.log("__module__:__function__() Unhandled scene activation. Scene was {}". format(data['service_data']['entity_id']))
def bedtime(self):
"""
Set up everything for moving up to the bedroom.
"""
self.call_service('climate/set_temperature', entity_id='climate.downstairs', temperature=downstairs_sleeping_temp)
self.call_service('alarm_control_panel/alarm_arm_night', entity_id='alarm_control_panel.home_alarm', code='1234'
I’m testing for which scene was activated manually because I could never figure out how to select a scene in the listen_event() call. There is a thread on this forum where Rene tried to help me. No matter what parameters I specified, ANY scene activation would trigger ALL callbacks that listen for