Announcement - AppDaemon 3.0 beta 1!

Which means what, exactly? Not sure where the file directive should or would be.

Sorry - ignore that, I was on my phone and couldn’t see properly. Can you post your apps.yaml file please?

I would guess you are setting a dependency for a file that doesn’t exist.

hmm only dependency i have is for utils which is in the apps folder.

apps.yaml


utils:
  class: utils
  module: utils




#### TESTING #####
Tests:
  class: tests
  module: tests

Transition:
  class: transition_lights
  module: transition_lights
  dependencies: utils

Intercom:
  class: intercom
  module: intercom
  entities:
    - intercom_input: input_text.intercom
      notify: googleassistant


##################



Startup Events:
  class: startup_events
  module: startup_events
  delay: 30

Battery Check:
  module: battery_monitor  
  class: battery_monitor
  dependencies: utils
  run_time: "06:05:00"  
  always_send: '0'
  persistent_notification: '1'
  threshold: '25'

Hardware Check:
  class: hardware_check
  module: hardware_check
  delay: '180'
  log: 1
  notify: 1
  hue: light.mbr
  zwave: light.entry_light_level

Home Assistant Events:
  class: ha_event_notifier
  module: ha_event_notifier

Zwave Events:
  class: zwave_event_notifier
  module: zwave_event_notifier

Playbar Volume Link:
  class: volume_link
  module: volume_link
  entities:
    - media_entity: media_player.sonos_playbar
      input_entity: input_number.playbar_volume   

Minimote 1:
  class: MiniMote
  module: minimote
  device: zwave.minimote1
  ## Push
  # scene_1_on:
  # scene_1_off:
  scene_1_toggle: light.batcave_light_level
  scene_3_toggle: light.basement_hall_lights_level
  scene_5_toggle: light.toy_room_lights_level
  scene_7_toggle: light.tv_room_lights_level
  ## Hold
  # scene_2_toggle: light.batcave_light
  # scene_4_toggle: light.basement_hall_lights_level
  # scene_6_toggle: light.toy_room_lights_level
  # scene_8_toggle: light.tv_room_lights_level

monitor_notifier:
  class: MonitorNotifier
  module: monitor_notifier  
  constrain_input_boolean: input_boolean.entry_notifications
  dependencies: utils
  entities: group.binary_entries
  reminder: '300'
  ttl: '15'


Motion Notification:
  class: MotionNotification
  constrain_input_boolean: input_boolean.motion_notifications
  constrain_presence: noone
  mute_time: 3
  module: motion_notification
  sensors: group.binary_motion_sensors


#### Motion Lights #######################
Porch Motion PIR:
  class: MotionLightSensor
  module: motion_lights
  binary_sensor: binary_sensor.front_porch_multisensor_motion
  switch: switch.porch_lights_switch
  delay: '120'
  light_sensor: sensor.front_porch_multisensor_luminance
  light_level: '15'
  # light_slider:
  constrain_start_time: "sunset - 00:15:00"
  constrain_end_time: "23:00:00"

Porch Motion Doorbell:
  class: MotionLightSensor
  module: motion_lights
  binary_sensor: binary_sensor.ring_front_door_motion
  switch: switch.porch_lights_switch
  delay: '120'
  light_sensor: sensor.front_porch_multisensor_luminance
  light_level: '15'
  # light_slider:
  constrain_start_time: "sunset - 00:15:00"
  constrain_end_time: "23:00:00"
  ###############################################


LED Control:
  class: GE_switch_led_control
  module: GE_switch_led_control
  entities:
    - entity: fan.master_bedroom_fan_level
      parameter: '3'
      off_value: 'LED on when light on'
      on_value: 'LED on when light off'
    - entity: fan.living_room_fan_level
      parameter: '3'
      off_value: 'LED on when light on'
      on_value: 'LED on when light off'



#### LIGH SCHEDULES ###########################
Lights Schedule V2 - General:
  class: lights_v2
  module: lights_v2
  # constrain_input_boolean: input_boolean.holiday_season,off
  lights:

    - light: switch.eave_lights_switch
      on_time: "sunset"
      on_random_start: -5
      on_random_end: 5
      off_time: "23:00:00"
      off_random_start: -5
      # off_random_end: 0
      ## Disable if Holiday Season is 'On'
      constrain_days: "mon,tue,wed,thu,fri,sat,sun"

    - light: switch.eave_lights_switch
      on_time: "05:40:00"
      on_random_start: -5
      on_random_end: 5
      off_time: "sunrise"
      off_random_start: -15
      # off_random_end: 0
      constrain_days: "mon,tue,wed,thu,fri"

    - light: switch.side_door_light_switch
      on_time: "sunset"
      on_random_start: -5
      on_random_end: 5
      off_time: "21:15:00"
      off_random_start: -5
      # off_random_end: 0
      constrain_days: "mon,tue,wed,thu,fri,sat,sun"

    - light: switch.back_door_light_switch
      on_time: "sunset"
      on_random_start: -5
      on_random_end: 5
      off_time: "22:00:00"
      off_random_start: -10
      off_random_end: 5
      constrain_days: "mon,tue,wed,thu,fri,sat,sun"

    - light: switch.office_lamp_switch
      on_time: "08:00:00"
      off_time: "16:00:00"
      constrain_days: "mon,tue,wed,thu,fri"  

    - light: switch.office_lamp_switch
      off_time: "20:00:00"
      constrain_days: "sat,sun"          
    
### Holiday Lights #############################

Lights Schedule V2 - Holiday:
  class: lights_v2
  module: lights_v2
  constrain_input_boolean: input_boolean.holiday_season
  lights:    
    - light: switch.christmas_lights_switch
      on_time: "sunset"
      on_random_start: -5
      on_random_end: 5
      off_time: "23:00:00"
      off_random_start: -5
      # off_random_end: 0
      constrain_days: "mon,tue,wed,thu,fri,sat,sun" 
      say_phrase: "Merry Christmas. The lights are on!"

    - light: switch.christmas_tree_switch
      on_time: "sunset"
      on_random_start: -5
      on_random_end: 5
      off_time: "23:00:00"
      off_random_start: -5
      # off_random_end: 0
      constrain_days: "mon,tue,wed,thu,fri,sat,sun"

    - light: switch.christmas_tree_switch
      on_time: "08:00:00"
      on_random_start: -5
      on_random_end: 5
      off_time: "09:15:00"
      off_random_start: -5
      # off_random_end: 0
      constrain_days: "mon,tue,wed,thu,fri,sat,sun"             
###############################################           


Double Tap Switch:
  class: zwave_double_tap
  module: zwave_double_tap
  dependencies: utils
  entities:
    
    ## Control Lamp on double tap
    - entity: zwave.living_room_light     
      events:
        - tap_up:
            - action_entity: light.living_room_lamp_level
              action: 'on'
        - tap_down: 
            - action_entity: light.living_room_lamp_level
              action: 'off'  

    ## Control Lamps on double tap
    - entity: zwave.master_bedroom_light     
      events:
        - tap_up:
            - action_entity: light.mbr
              action: 'on'
        - tap_down:
            - action_entity: light.mbr
              action: 'off'                 

    ## Step Fan Speed
    - entity: zwave.living_room_fan
      events:
        - tap_up:
            - action_entity: fan.living_room_fan_level
              action: 'on'
        - tap_down:
            - action_entity: fan.living_room_fan_level
              action: 'off'

##### Simply control the same light 
    - entity: zwave.island_lights     
      events:
        - tap_up:
            - action_entity: light.island_lights_level
              action: 'on'
        - tap_down:
            - action_entity: light.island_lights_level
              action: 'off'

    - entity: zwave.dining_lights     
      events:
        - tap_up:
            - action_entity: light.dining_lights_level
              action: 'on'
        - tap_down:
            - action_entity: light.dining_lights_level
              action: 'off'   
           
    - entity: zwave.side_door_light     
      events:
        - tap_up:
            - action_entity: light.side_door_light_switch
              action: 'on'
        - tap_down:
            - action_entity: light.side_door_light_switch
              action: 'off'                                                 
###############################################  



###############################################  ###############################################  
###############################################  ###############################################  



# Telegram Bot:
#   class: TelegramBotEventListener
#   module: telegram_bot_listener

# telegram_notifier:
#   class: TelegramNotifier
#   constrain_input_boolean: input_boolean.entry_notifications
#   dependencies: utils
#   entities: light.toy_room_lights
#   module: telegram_notifier
#   ttl: '1'

# RING Doorbell:
#   class: ring_doorbell_video_download
#   module: ring_doorbell_video_download
#   entities:
#     - entity: camera.front_door
#       trigger_entity: sensor.ring_front_door_last_activity

# foscam_living_room:
#   class: foscam_v2
#   module: foscam_v2
#   camsettings:
#     camera_type: FI9821W V2
#     camera_name: foscam_living_room_camera
#     host: 192.168.1.50
#     port: '88'
#     user: 'admin'
#     password: 'Flamingo1!'
#   logsettings:
#     loglevel: WARNING
#     logsensorlevel: WARNING
#     last_error_sensor: sensor.foscam_living_room_last_error
#   picsettings:
#     brightness_slider: input_number.foscam_living_room_brightness
#     contrast_slider: input_number.foscam_living_room_contrast
#     hue_slider: input_number.foscam_living_room_hue
#     saturation_slider: input_number.foscam_living_room_saturation
#     sharpness_slider: input_number.foscam_living_room_sharpness
#     default_pic_settings_switch: input_boolean.foscam_living_room_default_picture_settings
#     flip_switch: input_boolean.foscam_living_room_flip
#     mirror_switch: input_boolean.foscam_living_room_mirror
#     auto_infrared_switch: input_boolean.foscam_living_room_auto_infrared
#     infrared_switch: input_boolean.foscam_living_room_infrared
#   ptzsettings:
#     left_right_slider: input_number.foscam_living_room_left_right
#     up_down_slider: input_number.foscam_living_room_up_down
#     start_cruise_select: input_select.foscam_living_room_preset_cruise
#     stop_cruise_switch: input_boolean.foscam_living_room_stop_cruise
#     zoom_slider: input_number.foscam_living_room_zoom
#     preset_points_select: input_select.foscam_living_room_preset_points
#   alarmsettings:
#     motion_sensor: sensor.foscam_living_room_motion
#     motion_switch: input_boolean.foscam_living_room_motion_detect
#     soundalarm_sensor: sensor.foscam_living_room_sound_alarm
#     sensor_update_time: '10'
#   recordsettings:
#     snap_picture_switch: input_boolean.foscam_living_room_snap_picture_now
#     recording_sensor: sensor.foscam_living_room_recording
#     save_snap_dir: /camera/foscam_living_room/
#   dashboardsettings: 
#     use_dashboard: True
#     create_dashboard: True
#     create_alarm_dashboard: True
#     dashboard_file_name: living_room
#     alarm_dashboard_file_name: living_room_fullscreen
#     screen_width: 1024
#     screen_height: 600
#     show_full_screen_dashboard: True
#     full_screen_alarm_switch: input_boolean.foscam_living_room_toon_alarm_dash
#     time_between_shows: 60
#     show_time: 30

OK, it’s a bug that is making it error out instead of telling you which dependency is missing. I’ll fix the bug then maybe we can figure out what the actual error is :wink:

OK, I reproduced this and fixed the error - it was broken and also misleading. It seems to be caused when a module file is not found for an entry in apps.yaml. The fixed version will tell you which module is at fault, the fix is in dev if you want to take a look.

Is there a docker tag for Dev?

yep, it’s dev :slight_smile:

Playing a little at the moment. Great work!

The Numbers in the sensors looked nicer in AD2.
Auswahl_062
AD3
Auswahl_063

Interesting, I’ll have to track down what the change was …

I love your work and AppDaemon is perfect for me to create a beautifull Dashboard. But now my docker “moved” from 2.1.12 to 3.0.0b1 and I probabbly missed something :frowning:

Do you have any idea what I’m doing wrong on this?

2018-01-15 10:52:58.800878 INFO Configuration read from: /conf/appdaemon.yaml
Traceback (most recent call last):
File “/usr/local/bin/appdaemon”, line 11, in
load_entry_point(‘appdaemon==3.0.0b1’, ‘console_scripts’, ‘appdaemon’)()
File “/usr/local/lib/python3.6/site-packages/appdaemon/admain.py”, line 335, in main
admain.main()
File “/usr/local/lib/python3.6/site-packages/appdaemon/admain.py”, line 331, in main
self.run(appdaemon, hadashboard)
File “/usr/local/lib/python3.6/site-packages/appdaemon/admain.py”, line 58, in run
self.AD = ad.AppDaemon(self.logger, self.error, loop, **appdaemon)
File “/usr/local/lib/python3.6/site-packages/appdaemon/appdaemon.py”, line 88, in init
self.plugin_params = kwargs[“plugins”]
KeyError: ‘plugins’

Starting the docker container for the first time creates an appdaemon.conf like this:

log:
  logfile: STDOUT
  errorfile: STDERR
appdaeaemon: # <-- typo
  threads: 10
  plugins:
    HASS:
      ha_url:
      ha_key:

should be:

log:
  logfile: STDOUT
  errorfile: STDERR
appdaemon:
  threads: 10
  plugins:
    HASS:
      type: hass # <-- missing
      ha_url:
      ha_key:

to prevent first start problems.

There have been a number of breaking changes for the 3.0 beta, described at the top of this post. You need to reorganize your appdaemon.yaml file a little, and change a few other bits and pieces.

1 Like

Thanks - I’ll fix in the next release

Thank you! this was excately what I’ve missed to do. Reorganizing my appdaemon.yaml made my day :-).

Actually I’m a little more worrye about other bits and pieces, but this will become a later subject.

Have a great day!
Martin

icon_style_active in a dashboard seems to give me trouble… i.e.

device_tracker_pembo:
    widget_type: device_tracker
    title: 'Pembo'
    entity: group.pembo
#    icon_style_active: "mdi-human-male; color: #6666FF"
#    icon_style_inactive: mdi-human-male
    icon_on: mdi-human-male
    icon_off: mdi-human-male

if I enable the icon_style sections… I get the following error

2018-01-15 22:33:56.743854 WARNING ------------------------------------------------------------
2018-01-15 22:33:56.744061 WARNING Unexpected error during DASH creation
2018-01-15 22:33:56.744206 WARNING ------------------------------------------------------------
2018-01-15 22:33:56.744519 WARNING Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/appdaemon/dashboard.py", line 799, in get_dashboard
    dash = self._conditional_compile(name, skin, recompile)
  File "/usr/local/lib/python3.5/dist-packages/appdaemon/dashboard.py", line 751, in _conditional_compile
    dash = self._get_dash(name, skin, skindir)
  File "/usr/local/lib/python3.5/dist-packages/appdaemon/dashboard.py", line 554, in _get_dash
    dash = self._create_dash(name, css_vars)
  File "/usr/local/lib/python3.5/dist-packages/appdaemon/dashboard.py", line 436, in _create_dash
    dash, layout, occupied, includes = self._create_sub_dash(name, "dash", 0, {}, [], 1, css_vars, None)
  File "/usr/local/lib/python3.5/dist-packages/appdaemon/dashboard.py", line 526, in _create_sub_dash
    self._add_layout(lay, layout, occupied, dash, page, includes, css_vars, global_parameters)
  File "/usr/local/lib/python3.5/dist-packages/appdaemon/dashboard.py", line 410, in _add_layout
    widget["parameters"] = self._load_widget(dash, includes, name, css_vars, global_parameters)
  File "/usr/local/lib/python3.5/dist-packages/appdaemon/dashboard.py", line 356, in _load_widget
    final_widget = self._merge_styles(final_widget, name)
  File "/usr/local/lib/python3.5/dist-packages/appdaemon/dashboard.py", line 198, in _merge_styles
    styles = self._get_styles(widget[key], name, key)
  File "/usr/local/lib/python3.5/dist-packages/appdaemon/dashboard.py", line 185, in _get_styles
    result[pieces[0].strip()] = pieces[1]
IndexError: list index out of range

2018-01-15 22:33:56.744977 WARNING ------------------------------------------------------------
2018-01-15 22:33:56.745241 INFO function [get_dashboard] finished in 168 ms
Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/web_protocol.py", line 410, in start
    resp = yield from self._request_handler(request)
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/web.py", line 325, in _handle
    resp = yield from handler(request)
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/web_middlewares.py", line 93, in impl
    return (yield from handler(request))
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/web_urldispatcher.py", line 142, in handler_wrapper
    result = yield from result
  File "/usr/local/lib/python3.5/dist-packages/appdaemon/rundash.py", line 247, in load_dash
    return web.Response(text=response, content_type="text/html")
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/web_response.py", line 471, in __init__
    type(text))
TypeError: text argument must be str (<class 'dict'>)

Am I doing something wrong/stupid??

This is exciting @aimc! I will monitor the progress closely.

Great work so far

1 Like

Try removing the icon name from the styles, the styles have to be CSS, and that is incorrect syntax. The icon name belongs in the icon_off and icon_off directives as you already have it

Perfect - sure enough that’s it!

Thanks for the quick response.

Other than that, and restructuring the config, all the dashboards I have still work perfectly!

My new appdaemon.yaml looks like this for those who are struggling with the changes:

log:
  logfile: STDOUT
  errorfile: STDERR
  logsize: 100000
  log_generations: 3

appdaemon:
  disable_apps: 0
  threads: 10
  api_port: 5000

  plugins:
    HASS:
      type: hass
      ha_url: http://192.168.x.xxx:8123

hadashboard:
   dash_url: http://192.168.x.xxx:5050
1 Like

I’m using docker and pulling latest, any way I can stay on version 2?

latest dev branch error preventing AD from starting


Traceback (most recent call last):
File "/usr/local/bin/appdaemon", line 11, in <module>
load_entry_point('appdaemon==3.0.0b1', 'console_scripts', 'appdaemon')()
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 572, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2752, in load_entry_point
return ep.load()
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2405, in load
return self.resolve()
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2411, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/local/lib/python3.6/site-packages/appdaemon/admain.py", line 17, in <module>
import appdaemon.adapi as api
File "/usr/local/lib/python3.6/site-packages/appdaemon/adapi.py", line 4, in <module>
from aiohttp import web
File "/usr/local/lib/python3.6/site-packages/aiohttp/web.py", line 15, in <module>
from . import (hdrs, web_exceptions, web_fileresponse, web_middlewares,
File "/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 5, in <module>
from aiohttp.web_urldispatcher import SystemRoute
File "/usr/local/lib/python3.6/site-packages/aiohttp/web_urldispatcher.py", line 21, in <module>
from yarl import URL, unquote
ImportError: cannot import name 'unquote'