Community Hass.io Add-on: AppDaemon 3

there are some that can be found in the hadashboard forum in different topics.
i would love to see yours so just create a new topic in the hadashboard part and people will find it.
start the topic name with something like: “New skin: your skinname”
the glassic also can be found on the appdaemon github in assets

Excellent
thanks again!

1 Like

Like @ReneTode said, the appdaemon is created by @aimc, the addon however is my work.

1 Like

Hi! You plan to upgrade to the latest beta?

@frenck I’m using below appdaemon3 version on my hassio which is running on RasPI3.

Python Apps and HADashboard using AppDaemon 3.x for Home Assistant, 0.1.0

I’m trying to install additional python packages/modules but it’s generating some errors and not installing the “flask-assistant” module. Though it’s able to install “flask” module but failing for flask-assistant module as below…

[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] 00-banner.sh: executing…

Hass.io Add-on: AppDaemon3 v0.1.0
Python Apps and HADashboard using AppDaemon 3.x for Home Assistant
From:
By:

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing…
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing…
INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 03-version-requirements.sh: executing…
INFO: Supervisor version requirements checks passed.
[cont-init.d] 03-version-requirements.sh: exited 0.
[cont-init.d] 20-init-configuration.sh: executing…
[cont-init.d] 20-init-configuration.sh: exited 0.
[cont-init.d] 21-compiled-dir.sh: executing…
[cont-init.d] 21-compiled-dir.sh: exited 0.
[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 flask
Downloading Flask-0.12.2-py2.py3-none-any.whl (83kB)
Collecting Werkzeug>=0.7 (from flask)
Downloading Werkzeug-0.14.1-py2.py3-none-any.whl (322kB)
Collecting click>=2.0 (from flask)
Downloading click-6.7-py2.py3-none-any.whl (71kB)
Requirement already satisfied: Jinja2>=2.4 in /usr/lib/python3.6/site-packages (from flask)
Collecting itsdangerous>=0.21 (from flask)
Downloading itsdangerous-0.24.tar.gz (46kB)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib/python3.6/site-packages (from Jinja2>=2.4->flask)
Installing collected packages: Werkzeug, click, itsdangerous, flask
Running setup.py install for itsdangerous: started
Running setup.py install for itsdangerous: finished with status ‘done’
Successfully installed Werkzeug-0.14.1 click-6.7 flask-0.12.2 itsdangerous-0.24
Collecting flask-assistant
Downloading Flask-Assistant-0.2.94.tar.gz
Requirement already satisfied: Flask in /usr/lib/python3.6/site-packages (from flask-assistant)
Requirement already satisfied: requests in /usr/lib/python3.6/site-packages (from flask-assistant)
Collecting ruamel.yaml (from flask-assistant)
Downloading ruamel.yaml-0.15.35.tar.gz (260kB)
Requirement already satisfied: click>=2.0 in /usr/lib/python3.6/site-packages (from Flask->flask-assistant)
Requirement already satisfied: itsdangerous>=0.21 in /usr/lib/python3.6/site-packages (from Flask->flask-assistant)
Requirement already satisfied: Werkzeug>=0.7 in /usr/lib/python3.6/site-packages (from Flask->flask-assistant)
Requirement already satisfied: Jinja2>=2.4 in /usr/lib/python3.6/site-packages (from Flask->flask-assistant)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python3.6/site-packages (from requests->flask-assistant)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/lib/python3.6/site-packages (from requests->flask-assistant)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3.6/site-packages (from requests->flask-assistant)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/lib/python3.6/site-packages (from requests->flask-assistant)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib/python3.6/site-packages (from Jinja2>=2.4->Flask->flask-assistant)
Installing collected packages: ruamel.yaml, flask-assistant
Running setup.py install for ruamel.yaml: started
Running setup.py install for ruamel.yaml: finished with status ‘error’
Complete output from command /usr/bin/python3.6 -u -c “import setuptools, tokenize;file=‘/tmp/pip-build-8djr7rwz/ruamel.yaml/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-a1pse8gn-record/install-record.txt --single-version-externally-managed --compile:
sys.argv [‘-c’, ‘install’, ‘–record’, ‘/tmp/pip-a1pse8gn-record/install-record.txt’, ‘–single-version-externally-managed’, ‘–compile’]
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.6
creating build/lib.linux-armv7l-3.6/ruamel
copying .ruamel/init.py → build/lib.linux-armv7l-3.6/ruamel
creating build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./events.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./emitter.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./comments.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./main.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./error.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./dumper.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./nodes.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./composer.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./scalarstring.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./compat.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./setup.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./serializer.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./scalarfloat.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./util.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./scanner.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./scalarint.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./timestamp.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./parser.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./init.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./loader.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./constructor.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./tokens.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./representer.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./resolver.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./cyaml.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./reader.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./configobjwalker.py → build/lib.linux-armv7l-3.6/ruamel/yaml
copying ./LICENSE → build/lib.linux-armv7l-3.6/ruamel/yaml
running build_ext
building ‘_ruamel_yaml’ extension
creating build/temp.linux-armv7l-3.6
creating build/temp.linux-armv7l-3.6/ext
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/python3.6m -c ext/_ruamel_yaml.c -o build/temp.linux-armv7l-3.6/ext/_ruamel_yaml.o
unable to execute ‘gcc’: No such file or directory
error: command ‘gcc’ failed with exit status 1

----------------------------------------

Command “/usr/bin/python3.6 -u -c “import setuptools, tokenize;file=‘/tmp/pip-build-8djr7rwz/ruamel.yaml/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-a1pse8gn-record/install-record.txt --single-version-externally-managed --compile” failed with error code 1 in /tmp/pip-build-8djr7rwz/ruamel.yaml/
FATAL: Failed installing package flask-assistant
[cont-init.d] 81-python-packages.sh: exited 1.
[cont-finish.d] executing container finish scripts…
[cont-finish.d] 50-compiled-symlink.sh: executing…
[cont-finish.d] 50-compiled-symlink.sh: exited 0.
[cont-finish.d] 99-message.sh: executing…

            Oops! Something went wrong.

We are so sorry, but something went terribly wrong when
starting or running this add-on.

Be sure to check the log above, line by line, for hints.

[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.

adding @aimc as well…

i just recently took a look at flask, but i am pretty sure those 2 are not mixable.
both use an applike structure and you cant create an appdaemon app and a flask app as 1 app.

even if its possible i would suspect that is advanced use from python and i wouldnt try that in 1 docker on hassio.

Hi
I have just installed the AppDeamon3.
I manage to show the clock in the dashboard, but not any of my HA sensors lights, etc.
Can somebody help me?

appdeamon.yaml:
log:
accessfile: /config/appdaemon/logs/access.log
logfile: /config/appdaemon/logs/appdaemon.log
errorfile: /config/appdaemon/logs/error.log
log_generations: 3
log_size: 1000000
appdaemon:
threads: 10
app_dir: /config/appdaemon/apps
plugins:
HASS:
type: hass
ha_url: https://xyzxyz.xy:8123
ha_key: xyzxyz
hadashboard:
dash_url: http://192.168.1.12:5050
dash_dir: /config/appdaemon/dashboards

please next time show your code as code so we can see indention.
and what do you have in your dashboard file?

It was able to install flask. Only problem / error is with flask-assistant as mentioned in log content above.

Anyway i can have it installed. I am using hassio and there is nothing i can do or install outside hassio / homeassistant.

you might be able to install flask, but using flask(assistant) inside the appdaemon docker is in my idea not possible.
flask is a simular program as appdaemon is.
it is there to write apps and you use those apps to add things to a server.

apps for appdaemon and apps for flask are incompatible. a python script can only a flask app OR an appdaemon app, but not both.

so there is no use in trying to combine those 2 programs in 1 docker in my eyes (you may correct me if i am wrong)

even if it was possible, it still would not be possible inside hassio. flask works with a server that you want to be able to reach from outside the docker. the addon doesnt enable you to reach the flask server from outside, so you would need to change/recreate the addon.

Hi, sorry about that.
Here’ the formatted code:

log:
  accessfile: /config/appdaemon/logs/access.log
  logfile: /config/appdaemon/logs/appdaemon.log
  errorfile: /config/appdaemon/logs/error.log
  log_generations: 3
  log_size: 1000000
appdaemon:
  threads: 10
  app_dir: /config/appdaemon/apps
  plugins:
    HASS:
      type: hass
      ha_url: https://xyzxyz.xy:8123
      ha_key: xyzxyz
hadashboard:
  dash_url: http://192.168.1.12:5050
  dash_dir: /config/appdaemon/dashboards

Dashboard:

#
# Main arguments, all optional
#
title: Hovedpanel
widget_dimensions: [120, 120]
widget_margins: [5, 5]
columns: 8

gang_temperatur:
    widget_type: sensor
    title: Gangtemperatur
    units: "&deg;C"
    precision: 0
    entity: sensor.multisensor_01_temperature

weather_widget:
    widget_type: weather
    units: "&deg;C"

layout:
    - clock.clock(2x1), weather_widget(2x1)
    - gang_temperatur(2x1)
    - weather.weather(4x4)

i suspect that your url is giving a problem, or else that should work, what is in the logfile? (from the moment you strat appdaemon)

I’m very new to AppDaemon and Python, so i’ll begin with that. I am on HA 0.63.3

I’m trying to use AppDaemon to write an app that will allow me to listen to the event for when the cover_open service is called. Then I can use it to drive the GPIO pins with PWM for a DC motor. (i’m presenting at a booth at my local Salt Lake City Maker Faire with @DrZzs and we want to simulate the Garage Door cover but with a LEGO garage door).

When i try to add in the Python package for RPi.GPIO, i get this error in log:

[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: AppDaemon3 v0.1.0
 Python Apps and HADashboard using AppDaemon 3.x for Home Assistant
 From: Community Hass.io Add-ons
 By: Franck Nijhof <[email protected]>
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 
INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 03-version-requirements.sh: executing... 
INFO: Supervisor version requirements checks passed.
[cont-init.d] 03-version-requirements.sh: exited 0.
[cont-init.d] 20-init-configuration.sh: executing... 
[cont-init.d] 20-init-configuration.sh: exited 0.
[cont-init.d] 21-compiled-dir.sh: executing... 
[cont-init.d] 21-compiled-dir.sh: exited 0.
[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 RPi.GPIO
  Downloading RPi.GPIO-0.6.3.tar.gz
Installing collected packages: RPi.GPIO
  Running setup.py install for RPi.GPIO: started
    Running setup.py install for RPi.GPIO: finished with status 'error'
    Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-lqpo_j7p/RPi.GPIO/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-d7p47z6u-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-armv7l-3.6
    creating build/lib.linux-armv7l-3.6/RPi
    copying RPi/__init__.py -> build/lib.linux-armv7l-3.6/RPi
    creating build/lib.linux-armv7l-3.6/RPi/GPIO
    copying RPi/GPIO/__init__.py -> build/lib.linux-armv7l-3.6/RPi/GPIO
    running build_ext
    building 'RPi._GPIO' extension
    creating build/temp.linux-armv7l-3.6
    creating build/temp.linux-armv7l-3.6/source
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/python3.6m -c source/py_gpio.c -o build/temp.linux-armv7l-3.6/source/py_gpio.o
    unable to execute 'gcc': No such file or directory
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-lqpo_j7p/RPi.GPIO/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-d7p47z6u-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-lqpo_j7p/RPi.GPIO/
FATAL: Failed installing package RPi.GPIO
[cont-init.d] 81-python-packages.sh: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 50-compiled-symlink.sh: executing... 
[cont-finish.d] 50-compiled-symlink.sh: exited 0.
[cont-finish.d] 99-message.sh: executing... 
-----------------------------------------------------------
                Oops! Something went wrong.
 
 We are so sorry, but something went terribly wrong when
 starting or running this add-on.
 
 Be sure to check the log above, line by line, for hints.
-----------------------------------------------------------
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.  

Any ideas why? Is RPi.GPIO supported for AppDaemon and Hass.io? Or is there some other way I can control the Pi GPIO with PWM?

(I’ve looked at using the rpi_gpio_pwm component as a way, but current forum post confirmed that I also got error with HA and that component - How to use the PWM LED component in hassio)

thank you for any help or direction.

NOTE:
moved this to a separate topic on the forum - since it’s not really about AppDaemon3 anymore. More about how to use GPIO component within Hass.io addon - Addon to run Python Script that imports the RPi.GPIO component

Yes, I do of course!

Currently, I’m moving into my new house, so pretty limited in time. Hopefully, I am back at full speed next week.

2 Likes

@frenck - I’m getting ready to release b4 in the next short period of time, so give me a shout when you are making the addon if it’s before, so we can coordinate and have you go straight to b4 - there are no breaking changes so far.

4 Likes

@aimc I will ping you on Discord.

I’ve now updated the add-on for the 2.x branch, some of those things need to be ported to the 3.x branch add-on as well.

Hass.io has a new API security layer (not enforced yet) that needs to be supported in order to ensure the add-on keeps working in the future.

1 Like

Maybe i am wierd, but ha and hassio should be glad that there are programms like appdaemon that make it even better.
If hassio starts to make demands for other programs its a downhill slope.
If it goes on like this inthe future it will be
1)hassio with barebone ha or
2) homeassistant without hassio, but with a lot of other options.

@aimc, @frenck and @ReneTode I for one appreciate all of the work and time that you put in to make Home Assistant better (not meant to slight others).

When I get smart enough to help I will. If there is anything I can help with please ask.

I think that many are trying to make Hassio do everything that HA can do but not put any effort into it. That is a good expectation if you are paying for a program, but not for a free, open source program.

Thank you for your efforts.

3 Likes

Is the map_state supported on the sensor widget? I put the following definition for test and map_state doesn’t work but sub_entity_map does.

recu_special_mode:
  widget_type: sensor
  title: Rekuperator
  title2: Tryb pracy
  entity: sensor.rec_special_mode
  map_state:
    0: Harmonogram
    7: Wietrzenie
  sub_entity: sensor.rec_special_mode
  sub_entity_map:
    0: Harmonogram
    7: Wietrzenie