Making A Basic Mistake?

For some reason my widgets don’t update thier icons when and entity changes state from outside HAd. For example, I can turn a light on and off from my dashboard and everything works, icon changes etc… But if I turn the light on from home assistant or the wall switch, the icon on the dashboard stays off unless I refresh the page. This also applies to my switches.

Have I made a basic mistake here? I’ve searched the forum but couldn’t find a similar issue/answer to this problem.

you have probably a cashe problem from your browser.
try another browser or disable cashe

Thanks ReneTode. I have tried it in Edge, Chrome and WallPanel on my tablet. I’ve also tried with cache disabled as you suggest but I still get the same behaviour.

what version from AD?
what version from HA?
hassio, docker, venv, hasbian?
how does your AD log look right after startup?
did you try to restart everything including the device running AD and HA?
how does you appdaemon.yaml look?

what version from AD? 3.0.1
what version from HA? 0.77.2
hassio, docker, venv, hasbian? hassbian
how does your AD log look right after startup?
did you try to restart everything including the device running AD and HA? Yes
how does you appdaemon.yaml look?

appdaemon.yaml

log:
  logfile: /home/homeassistant/appdaemon/logs/appdaemon.log
  errorfile: /home/homeassistant/appdaemon/logs/appdaemonerr.log
appdaemon:
  disable_apps: 1
  threads: 10
  plugins:
    HASS:
      type: hass
      ha_url: http://192.168.1.69:8123
hadashboard:
  dash_url: http://192.168.1.69:5050
  dashboard_dir: /home/homeassistant/appdaemon/dashboards
  dash_force_compile: 1

Log file after service restart:

2018-09-01 12:34:33.440110 INFO SIGTERM Recieved
2018-09-01 12:34:33.451330 INFO AppDaemon: HASS: Disconnecting from Home Assistant
2018-09-01 12:34:33.777670 INFO AppDeamon Exited
2018-09-01 12:34:36.536590 INFO AppDaemon Version 3.0.1 starting
2018-09-01 12:34:36.543838 INFO Configuration read from: /home/homeassistant/appdaemon/appdaemon.yaml
2018-09-01 12:34:36.549751 INFO AppDaemon: Starting Apps
2018-09-01 12:34:36.551424 WARNING config_dir: /home exists, but is not writeable, owner: root
2018-09-01 12:34:36.559402 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2018-09-01 12:34:36.603026 INFO AppDaemon: HASS: HASS Plugin Initializing
2018-09-01 12:34:36.604260 INFO AppDaemon: HASS: HASS Plugin initialization complete
2018-09-01 12:34:36.605423 INFO Starting Dashboards
2018-09-01 12:34:36.608795 WARNING css: /home exists, but is not writeable, owner: root
2018-09-01 12:34:36.611718 WARNING javascript: /home exists, but is not writeable, owner: root
2018-09-01 12:34:36.625869 INFO API is disabled
2018-09-01 12:34:36.644469 INFO AppDaemon: HASS: Connected to Home Assistant 0.77.2
2018-09-01 12:34:36.694989 INFO AppDaemon: Got initial state from namespace default
2018-09-01 12:34:38.848646 INFO AppDaemon: Reading config
2018-09-01 12:34:38.850673 WARNING AppDaemon: File '/home/homeassistant/appdaemon/apps/apps.yaml' invalid structure - ignoring
2018-09-01 12:34:38.851544 INFO AppDaemon: /home/homeassistant/appdaemon/apps/apps.yaml added or modified
2018-09-01 12:34:38.852262 INFO AppDaemon: /home/homeassistant/appdaemon/apps/apps.yaml added or modified
2018-09-01 12:34:38.853213 INFO AppDaemon: Adding /home/homeassistant/appdaemon/apps to module import path
2018-09-01 12:34:38.855375 INFO AppDaemon: App initialization complete

the problem is that you didnt set a password which isnt optional anymore since HA upgrade to 0.77
beneath your ha_url you need to set:

ha_key: your_HA_api_password

in HA configuration you need

homeassistant:
  auth_providers:
   - type: legacy_api_password

http:
  api_password: your_HA_api_password

I made the changes you suggested and copied the config files and log and pasted below. I tried restarting everything but I’m still getting the same behaviour.

Home assistant configuration.yaml

homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: 
  longitude: 
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 196
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: Europe/London
  # Customization file
  customize: !include customize.yaml
  auth_providers:
    - type: legacy_api_password
# Enables the frontend
frontend:

# Enables configuration UI
config:

http:
  #trusted_networks:
  #  - 127.0.0.1
  #  - 192.168.1.0/24
  # Secrets are defined in the file secrets.yaml
  api_password: russell
  # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  # base_url: example.duckdns.org:8123

appdaemon.yaml

log:
  logfile: /home/homeassistant/appdaemon/logs/appdaemon.log
  errorfile: /home/homeassistant/appdaemon/logs/appdaemonerr.log
appdaemon:
  disable_apps: 1
  threads: 10
  plugins:
    HASS:
      type: hass
      ha_url: http://192.168.1.69:8123
      ha_key: russell

hadashboard:
  dash_url: http://192.168.1.69:5050
  dashboard_dir: /home/homeassistant/appdaemon/dashboards
  dash_force_compile: 1

Log file after pi restart and appdaemon service restart

2018-09-01 14:21:03.902611 INFO SIGTERM Recieved
2018-09-01 14:21:03.912971 INFO AppDaemon: HASS: Disconnecting from Home Assistant
2018-09-01 14:21:04.733284 INFO AppDeamon Exited
2018-09-01 14:21:07.491600 INFO AppDaemon Version 3.0.1 starting
2018-09-01 14:21:07.492325 INFO Configuration read from: /home/homeassistant/appdaemon/appdaemon.yaml
2018-09-01 14:21:07.497098 INFO AppDaemon: Starting Apps
2018-09-01 14:21:07.498591 WARNING config_dir: /home exists, but is not writeable, owner: root
2018-09-01 14:21:07.505634 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2018-09-01 14:21:07.547772 INFO AppDaemon: HASS: HASS Plugin Initializing
2018-09-01 14:21:07.548864 INFO AppDaemon: HASS: HASS Plugin initialization complete
2018-09-01 14:21:07.549677 INFO Starting Dashboards
2018-09-01 14:21:07.552645 WARNING css: /home exists, but is not writeable, owner: root
2018-09-01 14:21:07.555232 WARNING javascript: /home exists, but is not writeable, owner: root
2018-09-01 14:21:07.568050 INFO API is disabled
2018-09-01 14:21:07.584983 INFO AppDaemon: HASS: Connected to Home Assistant 0.77.2
2018-09-01 14:21:07.637193 INFO AppDaemon: Got initial state from namespace default
2018-09-01 14:21:09.798423 INFO AppDaemon: Reading config
2018-09-01 14:21:09.800005 WARNING AppDaemon: File '/home/homeassistant/appdaemon/apps/apps.yaml' invalid structure - ignoring
2018-09-01 14:21:09.800497 INFO AppDaemon: /home/homeassistant/appdaemon/apps/apps.yaml added or modified
2018-09-01 14:21:09.800858 INFO AppDaemon: /home/homeassistant/appdaemon/apps/apps.yaml added or modified
2018-09-01 14:21:09.801323 INFO AppDaemon: Adding /home/homeassistant/appdaemon/apps to module import path
2018-09-01 14:21:09.803690 INFO AppDaemon: App initialization complete

is there anything in the error log?
/home/homeassistant/appdaemon/logs/appdaemonerr.log

please also add

log:
  accessfile: /home/homeassistant/appdaemon/logs/dashboard_acces.log

to your appdaemon yaml and show the log in that file
and try if you have the same behaviour on your PC in chrome
if so then look in the console for errors (CTRL shift I) in chrome
if still problems try a simple new dashboard with 1 switch
if that also gives trouble please show that dashboard.

There’s nothing in the error log, only errors from a few days ago.
Added log to the configuration and it shows the following after restart:

2018-09-01 15:09:25.056013 WARNING css: /home exists, but is not writeable, owner: root
2018-09-01 15:09:25.059132 WARNING javascript: /home exists, but is not writeable, owner: root

I checked chrome console for errors and it gave the following:

Uncaught Error: You cannot apply bindings multiple times to the same element.
    at m (knockout-3.4.1.js:70)
    at h (knockout-3.4.1.js:69)
    at Object.a.Sb (knockout-3.4.1.js:76)
    at basedisplay.WidgetBase (dashboard.js:273)
    at new basedisplay (application.js:190)
    at HTMLDocument.<anonymous> (wallpanel_init.js:115)
    at j (jquery-3.1.1.min.js:2)
    at k (jquery-3.1.1.min.js:2)
m @ knockout-3.4.1.js:70
h @ knockout-3.4.1.js:69
a.Sb @ knockout-3.4.1.js:76
WidgetBase @ dashboard.js:273
basedisplay @ application.js:190
(anonymous) @ wallpanel_init.js:115
j @ jquery-3.1.1.min.js:2
k @ jquery-3.1.1.min.js:2
setTimeout (async)
r.readyException @ jquery-3.1.1.min.js:2
(anonymous) @ jquery-3.1.1.min.js:2
j @ jquery-3.1.1.min.js:2
k @ jquery-3.1.1.min.js:2
setTimeout (async)
(anonymous) @ jquery-3.1.1.min.js:2
i @ jquery-3.1.1.min.js:2
fireWith @ jquery-3.1.1.min.js:2
fire @ jquery-3.1.1.min.js:2
i @ jquery-3.1.1.min.js:2
fireWith @ jquery-3.1.1.min.js:2
k @ jquery-3.1.1.min.js:2
setTimeout (async)
(anonymous) @ jquery-3.1.1.min.js:2
i @ jquery-3.1.1.min.js:2
fireWith @ jquery-3.1.1.min.js:2
fire @ jquery-3.1.1.min.js:2
i @ jquery-3.1.1.min.js:2
fireWith @ jquery-3.1.1.min.js:2
ready @ jquery-3.1.1.min.js:2
R @ jquery-3.1.1.min.js:3

I made a simple dash as so:

##
## Main arguments, all optional
##
title: simple dash
widget_dimensions: [58, 61]
widget_size: [1, 1]
widget_margins: [5, 5]
columns: 16

layout:
    - kitchen_extractor

kitchen_extractor:
    widget_type: switch
    title: Kitchen Extractor
    entity: switch.extractor
    icon_on: mdi-fan
    icon_off: mdi-fan-off

This worked!!

Okay, digging in to this further, the clue for me was from the error in chrome “cannot apply bindings multiple times to the same element”. This made me think I may have duplicated somthing, somewhere.

When checking the dash’s, I realised I had the same widget reference in my top_panel as my bottom_panel. I renamed them and now it’s fixed and working!!!

Thanks for all your help getting to the answer.

1 Like