Unable to connect to frontend

Hi guys

The last few days I’ve noticed that my web browser page which points to my duckdns.org address isn’t working.

eg my address is like: https://myaccount.duckdns.org/states and the webpage shows “Unable to connect to Home Assistant. Retry”

If I try to open my web based shortcut on my Android phone, it just flashes up and immediately closes.

I had recently done an update as my front end said there was an update available and I did the usual steps.

I’ve rebooted my Raspberry Pi but still no luck. I’ve also gone to DuckDNS and logged in and grabbed my IP address and tried changing my address in the web browser.

eg From: https://myaccount.duckdns.org/states
to https://202.159.135.81/states

and I get the message: This site can’t be reached. 202.159.135.81 refused to connect.

Other than the update, which I’ve done plenty of times before, I haven’t made any changes.

I’m not sure where to go from here.

PS The duckDNS address and the IP addresses used above were obviously changed for this post :slight_smile:

Any help would be appreciated.

If you know what port you are configured for, apart from 80, eg 8123 then you need to add that to your URL

https://myaccount.duckdns.org:8123/states

I’m not sure what changed as my Chrome Browser opens with the same tabs each time and it’s always been set to https://myaccount.duckdns.org/states and worked.

Furthermore, the same time my web browser on my PC stopped working, so did the shortcut on my Android phone.

if I try https://myaccount.duckdns.org:8123/ I get the message myaccount.duckdns.org took too long to respond.

I checked my IP address with what DuckDNS thinks I have and they match.

Like I said, I haven’t changed my usual address in the tabs but either way, none of them work.

I don’t recall them working since the last update which according to my web browser history was done on the 7th June.

EDIT: I’ve PuTTY’ed into my Pi and I’ve initiated a reboot. I’ll see how that goes. Seems to be taking a while to boot up.

ssl certificate expired?

1 Like

No. I manually updated it.

I did post a question as to why my automatic script didn’t work but no one answered as to why it didn’t and when it got to about 8 days remaining, I manually did the update.

You actually answered that post but I had the ports configured

EDIT: It seems to be taking a while to reboot. I open a PuTTY session but when I go to the IP address it sits there until it times out. It’s probably been 5 minutes.

I have to head out soon. If I can’t PuTTY i when I get back I will power the Pi off.

is the duck dns ipaddress==your WAN IP address? Has your ISP switched to CGNAT? (I know ABB has but you’re with Internode right? ABB let you opt out)

Yes. I checked with whatismyip.com and it shows the same as DuckDNS. I have to head out now. Will check back in a few hours.

Can you connect using your lan address eg https://192.168.0.10:8123 ?

Your browser will throw a security error but you should be able to bypass that and proceed.

Do you have a fixed IP set on your router with the correct port number forwarding to it from the Wan ?

My FritzBox has the Raspberry Pi set to always be given the same IP address. 124.168.178.122

I can Putty into this address. If I try to go to https://124.168.178.122:8123/states (or without the /states) I get a “Can’t connect as it took too long to respond.”

I PuTTY’ed in and re-ran the update steps as per https://www.home-assistant.io/docs/installation/hassbian/common-tasks/#update-home-assistant which were:

```
$ sudo systemctl stop [email protected]
$ sudo -u homeassistant -H -s
$ source /srv/homeassistant/bin/activate
$ pip3 install --upgrade homeassistant
$ exit
$ sudo systemctl start [email protected]
```

I did this in case it was something wrong with the last update attempt or if there had been a bug and there was a later update.

Both whatismyip and duckdns show my ISP assigned IP as being the same. I haven’t made any changes to my router. The only change I can think of between when I last knew it was working to when it wasn’t was the last update.

If you cannot log into it with the lan address then you won’t get in via the wan. Have you run the checker against your config to see if there are any errors that need fixing?

Does your HA log show any issues ?

have you added ssdp: to your config?
if i add it, and reboot HassOS, frontend never loads, and with no issues in log file
only happens on full reboot, not a restart, issue already opened on github

Yamlint.com says my configuration is ok.

It reads:

2019-06-12 14:10:13 ERROR (Thread-2) [homeassistant.util.yaml.loader] while parsing a block collection
in “/home/homeassistant/.homeassistant/configuration.yaml”, line 288, column 7
expected , but found ‘’
in “/home/homeassistant/.homeassistant/configuration.yaml”, line 295, column 8
2019-06-12 14:10:13 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/homeassistant/.homeassistant/configuration.yaml: while parsing a block collection
in “/home/homeassistant/.homeassistant/configuration.yaml”, line 288, column 7
expected , but found ‘’
in “/home/homeassistant/.homeassistant/configuration.yaml”, line 295, column 8

Here’s that section of my configuration.yaml file:

  - alias: 'Someone At The Front Door Nighttime'
    trigger:
      platform: template
      value_template: '{{states.switch.front_door_15.attributes.device_tripped}}'
    # The Condition Syntax from https://www.home-assistant.io/docs/scripts/conditions/
    condition:
      condition: time
      # At least one of the following is required.
      before: '08:00:00'
      after: '20:00:00'
      # Text to Speech
    action:
      - service: tts.google_say
        entity_id: media_player.nighttime_doorbell
        data:
          message: 'Motion Detected At The Front Door'
    # Bedroom Light On - Red at Full Brightness
      - service: light.turn_on
    #   entity_id: light.yeelight_bedside_7811dc9201bd 
        entity_id: light.yeelight_bslamp1_7811dc9201bd
    data:
           brightness: 200
           color_name: Red         

The reason the entity_id near the end was hashed out was because I noticed my lamp wasn’t coming on when I tested it (it was working previously and I assumed an update had broken it). On looking at my entity list, it appeared the ID had changed, so I copied the line, hashed out the original (in case I needed to know what it originally was) and put in the new one. Hitting the trigger button on the web page didn’t work and I hadn’t got around to further testing before this issue of the front end not loading.

According to Notepad++, line 288 is the one that reads:

  - service: tts.google_say

Line 295 is the one that reads:

    entity_id: light.yeelight_bslamp1_7811dc9201bd

With regards to this section, I can’t see what’s different (syntax wise) between it and the previous section which reads:

>   - alias: 'Someone At The Front Door Daytime'
>     trigger:
>       platform: template
>       value_template: '{{states.switch.front_door_15.attributes.device_tripped}}'
>     # The Condition Syntax from https://www.home-assistant.io/docs/scripts/conditions/
>     condition:
>       condition: time
>       # At least one of the following is required.
>       after: '08:00:00'
>       before: '20:00:00'
>       # Text to Speech
>     action:
>       - service: tts.google_say
>         entity_id: media_player.whole_house_doorbell
>         data:
>           message: 'Motion Detected At The Front Door'
>     # Bedroom Light On - Red at Full Brightness
> #      - service: light.turn_on
> #       entity_id: light.yeelight_bedside_7811dc9201bd 
> #        data:
> #           brightness: 254
> #           color_name: Red

I had to Google what SSDP was (found out it was “Simple Service Discovery Protocol”). I haven’t added that.

Sorry if the replies are late. This week I’m on early shift at work so up at 3:30am and my afternoons being free mean I’ve got to take my daughter to after-school activities and then it’s early to bed. In other words, not much time to play. :slight_smile:

A YAML checker will not tell you exactly what is wrong , you need to check the config against HA using the built in checker

sudo -u homeassistant -H -s
source /srv/homeassistant/bin/activate
hass --script check_config

The help page for Hassbian is here

Also your google tts is wrong. This platform renamed to google_translate from google since release 0.92.

See here for google tts docs

That’s indeed interesting… My tts looks like this:

tts:
  - platform: google_translate
    service_name: google_say

The google_translate was added in 0.92 as you say but it didn’t change the service_name and I didn’t either. I see in the docs it’s not there either so I guess I should delete it however it works as is with no errors and I do have a service.google_say

and then all my mini-media tts’s stopped working till I changed then from google to google_translate!

The console shows:

Testing configuration at /home/homeassistant/.homeassistant
ERROR:homeassistant.util.yaml.loader:while parsing a block collection
  in "/home/homeassistant/.homeassistant/configuration.yaml", line 288, column 7
expected <block end>, but found '<block mapping start>'
  in "/home/homeassistant/.homeassistant/configuration.yaml", line 295, column 8
Failed config
  General Errors:
    - Error loading /home/homeassistant/.homeassistant/configuration.yaml: while parsing a block collection
  in "/home/homeassistant/.homeassistant/configuration.yaml", line 288, column 7
expected <block end>, but found '<block mapping start>'
  in "/home/homeassistant/.homeassistant/configuration.yaml", line 295, column 8

The next part of https://www.home-assistant.io/docs/installation/hassbian/common-tasks/#manually-launch-home-assistant says to read the home assistant log file. Following the instructions, it shows:

2019-06-12 14:10:13 ERROR (Thread-2) [homeassistant.util.yaml.loader] while par$
  in "/home/homeassistant/.homeassistant/configuration.yaml", line 288, column 7
expected <block end>, but found '<block mapping start>'
  in "/home/homeassistant/.homeassistant/configuration.yaml", line 295, column 8
2019-06-12 14:10:13 ERROR (MainThread) [homeassistant.bootstrap] Error loading $
  in "/home/homeassistant/.homeassistant/configuration.yaml", line 288, column 7
expected <block end>, but found '<block mapping start>'
  in "/home/homeassistant/.homeassistant/configuration.yaml", line 295, column 8

I’m a little confused. Yes I know that’s not surprising :slight_smile:

You say the platform renamed from “google” to “google_translate” but I never used the line: platform: google. I used platform: template

The linked page for the TTS docs say to write:

tts:
  - platform: google_translate

My confusion relates to where, and how, does my script get changed. I’m really sorry for being thick.

Currently, (looking at just my “Daytime” section), it reads:

  - alias: 'Someone At The Front Door'
    trigger:
      platform: template
      value_template: '{{states.switch.front_door_15.attributes.device_tripped}}'
    # The Condition Syntax from https://www.home-assistant.io/docs/scripts/conditions/
    condition:
      condition: time
      # At least one of the following is required.
      after: '08:00:00'
      before: '20:00:00'
      # Text to Speech
    action:
      - service: tts.google_say
        entity_id: media_player.whole_house_doorbell
        data:
          message: 'Motion Detected At The Front Door'
    # Bedroom Light On - Red at Full Brightness
#      - service: light.turn_on
#       entity_id: light.yeelight_bedside_7811dc9201bd 
#        data:
#           brightness: 254
#           color_name: Red

Because you say the platform should be changed to google_translate, should the top part read:

  - alias: 'Someone At The Front Door'
    trigger:
      platform: google_translate
      value_template: '{{states.switch.front_door_15.attributes.device_tripped}}'

or should I be changing the “Action” setting part of the trigger-condition-action from:

action:
  - service: tts.google_say
    entity_id: media_player.whole_house_doorbell
    data:
      message: 'Motion Detected At The Front Door'

to

action:
  - platform: google_translate
    entity_id: media_player.whole_house_doorbell
    data:
      message: 'Motion Detected At The Front Door'

Anyway, getting back to the error in the logs, it says it expected a block end at line 288 but found a block mapping start. I know a block mapping start is indicated by the dash -, but not sure what a block end would look like.

Furthermore, since my nighttime section (which contains line 288) is virtually the same as the “daytime” section above it other than the 8am to 8pm section and the name of the speaker group, why is there no errors with line 266??

Thanks for all your help guys. I really am trying to understand the coding.

Hello,

I am in work at the moment so can only give a little help. What happens if you remove all your automations (temporarily) then try and restart Hassbian ? If that works then the error is 100% with your automation and we can dig further then.

Just noticed that you only have 1 action on your daytime automation therefore you do not need the dash before the service as the bedroom light is rem’d out

change this

   action:
  - service: tts.google_say
    entity_id: media_player.whole_house_doorbell
    data:
      message: 'Motion Detected At The Front Door'

to this

action:
    service: tts.google_say
    entity_id: media_player.whole_house_doorbell
    data:
      message: 'Motion Detected At The Front Door'

Looking at my config under services (far left of Developer Tools) and it shows tts.google_translate_say

Does yours show the same as mine ?

google%20ttsgoogle%20tts2

I’ve removed the dash and then PuTTY’ed in and ran the following commands:

```
sudo systemctl stop [email protected]
```

then

```
sudo systemctl start [email protected]
```

I then mapped to the Hassbian via Network on my Windows PC and the Home-Assistant.log still shows the same error message (with the current date/time stamp) showing the issue with line 288.

You said the daytime section needed the dash removed because there was only one action. In the Nighttime one, I have 2 actions, so I gather the dashes stay. It currently reads:

  - alias: 'Someone At The Front Door Nighttime'
    trigger:
      platform: template
      value_template: '{{states.switch.front_door_15.attributes.device_tripped}}'
    # The Condition Syntax from https://www.home-assistant.io/docs/scripts/conditions/
    condition:
      condition: time
      # At least one of the following is required.
      before: '08:00:00'
      after: '20:00:00'
      # Text to Speech
    action:
      - service: tts.google_say
        entity_id: media_player.nighttime_doorbell
        data:
          message: 'Motion Detected At The Front Door'
    # Bedroom Light On - Red at Full Brightness
      - service: light.turn_on
    #   entity_id: light.yeelight_bedside_7811dc9201bd 
       entity_id: light.yeelight_bslamp1_7811dc9201bd
    data:
           brightness: 200
           color_name: Red        

It is this section that contains line 288 which seems to be the issue regarding the log file.

Since I can’t access the front end at the moment, either via https://mydomain.duckdns.org/states; https://192.168.178.122/states; https://mydomain.duckdns.org:8123/states; or https://192.168.178.122:8123/states; I can’t check :frowning:

I noticed I had a section up the top that read:

# Text to speech
    tts:
      - platform: google_translate
        service_name: google_say

I tried that and now the log file reads"

2019-06-14 15:08:14 WARNING (MainThread) [homeassistant.components.http] Configuring api_password via the http component has been deprecated. Use the legacy api password auth provider instead. For instructions, see https://www.home-assistant.io/docs/authentication/providers/#legacy-api-password
2019-06-14 15:08:14 WARNING (MainThread) [homeassistant.components.http.auth] legacy_api_password support has been enabled.
2019-06-14 15:08:19 ERROR (MainThread) [homeassistant.setup] Setup failed for introduction: Integration not found.

I found that the last error means I need to remove the line:

# Show links to resources in log and frontend
introduction:

I hashed it out and restarted the services and the that line is now gone from the log file.

EDIT:

I looked at the web page the error log suggested and I think mine is set ok.

It currently reads (with adjustments for privacy/security)

http:
  # Secrets are defined in the file secrets.yaml
  # api_password: !secret http_password
  api_password: MyPassw0rd
  # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  ssl_certificate: /etc/letsencrypt/live/mydomain.duckdns.org/fullchain.pem
  ssl_key: /etc/letsencrypt/live/mydomain.duckdns.org/privkey.pem
  base_url: mydomain.duckdns.org

The above is correct I think???

EDIT:

Ok, after hashing out the introduction the front end now loads (with some errors which are a totally separate issue)

My log file error message now reads:

2019-06-14 17:07:39 WARNING (MainThread) [homeassistant.components.http] Configuring api_password via the http component has been deprecated. Use the legacy api password auth provider instead. For instructions, see https://www.home-assistant.io/docs/authentication/providers/#legacy-api-password
2019-06-14 17:07:39 WARNING (MainThread) [homeassistant.components.http.auth] legacy_api_password support has been enabled.
2019-06-14 17:07:41 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=270 from 2019-06-14 07:01:48.394661)
2019-06-14 17:07:43 ERROR (Thread-6) [yahooweather] No woid is received!
2019-06-14 17:07:43 CRITICAL (Thread-6) [homeassistant.components.yweather.sensor] Can't retrieve WOEID from yahoo!

If you now have the frontend up then you can start by adding each automation in turn and running the built in configuration checker until it passes. As we know YAML is very space dependant so it could take a while to get it to pass succesfully.