akasma74 / Hass-Custom-Alarm

It is a fork of "Yet another take on a home assistant custom alarm" that will exist until its author is back to our Earth
79 stars 29 forks source link

Alarm panel not loading #95

Open glorifiedg opened 4 years ago

glorifiedg commented 4 years ago

Using Home Assistant 0.109.6 but happening since ever. Installed multiple times and after first use the alarm panel does't load properly, showing no buttons.

Error:

Logger: frontend.js.latest.202004272
Source: components/system_log/__init__.py:209
First occurred: 13:02:15 (195 occurrences)
Last logged: 13:02:19
https://xxx.duckdns.org:8123/bwalarm/lib/countdown360.js:132:13 Uncaught TypeError: Assignment to constant variable.
https://xxx.duckdns.org:8123/api/panel_custom/alarm-1.js:647:42 Uncaught TypeError: $(...).width is not a function

bwalarm.yaml

platform: bwalarm
panel:
  cameras: []
enable_night_mode: false
states:
  armed_away:
    immediate:
    - binary_sensor.porta_da_entrada
    delayed: []
    override: []
    pending_time: '60'
    warning_time: '30'
    trigger_time: '1200'
  armed_home:
    immediate:
    - binary_sensor.porta_da_entrada
    delayed: []
    override: []
    pending_time: '0'
    warning_time: 0
    trigger_time: '1200'
  armed_night:
    immediate: []
    delayed: []
    override: []
    pending_time: 0
    warning_time: 0
    trigger_time: 600
users:
- id: XXX
  name: Home Assistant Cloud
  enabled: false
  code: XXX
  picture: ha.png
- id: XXX
  name: Hass.io
  enabled: false
  code: XXX
  picture: ha.png
- id: XX
  name: XXX
  enabled: false
  code: XXX
  picture: ha.png
- id: XXX
  name: XXX
  enabled: false
  code: XXX
  picture: ha.png
- id: XXX
  name: XXX
  enabled: false
  code: XXX
  picture: ha.png
- id: XXX
  name: Home Assistant Cast
  enabled: false
  code: XXXX
  picture: ha.png
enable_persistence: true
code: 'XXX'
ignore_open_sensors: true
passcode_attempts_timeout: '300'
passcode_attempts: '3'
mqtt:
  enable_mqtt: true
  pending_on_warning: false
  payload_disarm: DISARM
  state_topic: home/alarm
  override_code: true
  payload_arm_away: ARM_AWAY
  payload_arm_night: ARM_NIGHT
  command_topic: home/alarm/set
  payload_arm_home: ARM_HOME
  qos: 0
admin_password: 'XXX'
akasma74 commented 4 years ago

Do you mean that it always worked like that? Have you tried a) a different browser and b) without duckdns? It looks like a JS issue.

glorifiedg commented 4 years ago

Yes, I have that behavior even in older versions of HA.

Just tried on firefox an IE, both on DuckDNS and internal network path, and got the same error.

Any ideas?

akasma74 commented 4 years ago

Was this behaviour introduced with one of the recent alarm version? Do you know a combinaton of HA/bwalarm that worked as expected? Can you open JavaScript console of your browser and post what's there?

glorifiedg commented 4 years ago

No and no.

This what I get in console: https://imgur.com/uGygVtK

Interesting enough: if I have the console open and refresh the page, It works normally https://imgur.com/Gi9KbJc If I go to other HA page and come back to BWalarm it shows like this again.

akasma74 commented 4 years ago

thanks for the log, I'l look into it.

If I go to other HA page and come back to BWalarm it shows like this again.

do you mean it doesn't work?

glorifiedg commented 4 years ago

Yes, if I go to to another page, the error appears again.

Thank you for looking into it!

akasma74 commented 4 years ago

Did you clear cache of your browsers? I take that you run Windows and use Chrome but in Firefox and IE it's the same?

glorifiedg commented 4 years ago

Will try to clear the cache. Anyway, tried on both and also EDGE and still the same problem. Firefox was a brand new install.

akasma74 commented 4 years ago

Can you try from a phone/tablet?

glorifiedg commented 4 years ago

Just tried on chrome running on Android after cache cleared and still the same error.

akasma74 commented 4 years ago

Thanks for checking. It's getting more and more interesting.. In the initial issue description there are two errors - from countdown36.js and alarm-1.js In your JS console output I can see ony the latter - does that mean that you no longer get another errors?

glorifiedg commented 4 years ago

Actually, the only consistent error is this one:

Logger: frontend.js.latest.202004272
Source: components/system_log/__init__.py:209
First occurred: 11:30:04 (1 occurrences)
Last logged: 11:30:04

https://XXXXX.duckdns.org:8123/api/panel_custom/alarm-1.js:647:42 Uncaught TypeError: $(...).width is not a function
glorifiedg commented 4 years ago

Is there an option to force an auto refresh after clicking on "Alarm"? I think that would solve the problem.

I saw that custom header had a problem similar to this one some weeks ago.

akasma74 commented 4 years ago

Is there an option to force an auto refresh after clicking on "Alarm"? I think that would solve the problem.

could you tell me why you think so?

I saw that custom header had a problem similar to this one some weeks ago.

could you provide me with a link?

glorifiedg commented 4 years ago

I just say that because everything works if I click refresh on browser AFTER opening bwalarm tab.

Can't find it anymore on their GIT but will keep looking.

akasma74 commented 4 years ago

Could you update the original issue report with the version of your alarm?

akasma74 commented 4 years ago

@glorifiedg I'm still waiting for the version of your alarm.

akasma74 commented 4 years ago

@glorifiedg I'm still waiting for the version of your alarm.

glorifiedg commented 4 years ago

This integration: v1.12.4

Home Assistant: v0.112.4

Python: v(3,7,7,final,0)