NWS radar images

I’m also not sure that the component handles server outages well. It should cache the last successful update time and show unavailable if it is more than 30 minutes old or something like that.

Thanks for the timely replies.

That’s a good question. I’ve configured for standard, and used this URL for verification:

https://radar.weather.gov/ridge/radar_lite.php?rid=LWX&product=NCR&overlay=11101111&loop=yes

Aside from the menu of options, the image in HA is just like what’s shown in the frame. Still, an HA Restart cleared the issue. That seems like sufficient evidence to know something in HA had stalled.

This all matches up. I think I need to put in more debug logging so that you could turn it on when needed to diagnose this sort of thing.

There are times it could be useful. The only other issue I have is when using the iPhone companion app. Occasionally, it won’t immediately pull up an image when getting cellular data. But stalling like it did on my desktop computer has never happened before. I’d have to either be clairvoyant or continuously have it in debug mode.

An approach might be to anticipate a stall with a timeout timer and somehow trap the state of the component by leaving an audit trail.

You can set the debug level whenever in the GUI via a service call if needed. If the integration isn’t updating for example, this would be a good clue. If it is updating but not providing a picture, that is also a clue. This is a good first step anyway.

Agreed. That sounds like a good approach.

I just checked and there already are some very rudimentary debug statements in the data update call and also in the method used to provide the image to HA. So next time you could turn on debug level for this component and get an idea of its symptoms.

Is this the proper directive?

logs:
  custom_components.nwsradar: debug

Looks correct to me, but it will spam your logs all the time if done in your configuration. What I was referring to is this service

Edit:. The debug statements so far are honestly not going to be helpful when on all the time. But when turned on when it is stalled, you could help me know whether it is getting updates and if HA is successfully calling the method to provide the image itself.

It would be under logger, e.g.:

logger:
  default: critical
  logs:
    custom_components.nwsradar: debug

But I see there are more options available in the instructions. Typically I have logger commented out. I suppose I’d have to set it up for logging at the default level and then use the service to change it when it misbehaves. Correct?

You are right logger. I would recommend just setting the default to error or info and not specifying a level for nwsradar. Most problems are logged as error, so I personally wouldn’t filter those out. Then when it stalls, use the service to set the level to debug for this custom component only.

You can run the service in the dev section of the UI somewhere in the toolbar. You don’t have to create a script for it.

Yes, I know how to use the service under Developer Tools>Service. But the instructions say the level can be altered on the fly. That implies the service for the component has to be there in the first place. Right?

The logger component needs to be in your configuration I assume, but that’s it. You said you had it commented out. Do you get any logging?

Currently, I get the home-assistant.log output at the default level. I think that much occurs without explicitly having logging in the configuration. It must work that way, or I wouldn’t get anything. This seems to confirm it:

https://community.home-assistant.io/t/home-assistant-log-file-not-created/48644

All very confusing, but I’m pretty sure you do not need to explicitly set a log level for this (edit: or any) interegration to be able to set it later using a service.

No matter. I’ll try to experiment with it when I have a bit more time. At the very least, logger must be un-commented in the configuration because there’s no logger service listed without it. In addition, I’ll try to make sure I can turn on critical and change it to info to confirm things are working. I don’t want to be guessing when I need it to work.

BTW, thanks for the help and info.

I think I have it working. I say ‘think’ because I have yet to find a direct indicator that a service call was successful. For anyone who’s interested, this is how it’s set up in configuration.yaml:

logger:
  default: critical
  logs:
    custom_components.nwsradar: debug

This is what’s reported in the home-assistant.log file:

2020-06-20 19:38:29 DEBUG (SyncWorker_4) [custom_components.nwsradar.camera] update image
2020-06-20 19:38:29 DEBUG (SyncWorker_4) [custom_components.nwsradar.camera] display image
2020-06-20 19:38:39 DEBUG (SyncWorker_7) [custom_components.nwsradar.camera] display image
2020-06-20 19:38:49 DEBUG (SyncWorker_8) [custom_components.nwsradar.camera] display image
2020-06-20 19:43:39 DEBUG (SyncWorker_5) [custom_components.nwsradar.camera] update image
2020-06-20 19:59:09 DEBUG (SyncWorker_5) [custom_components.nwsradar.camera] update image
2020-06-20 20:30:09 DEBUG (SyncWorker_4) [custom_components.nwsradar.camera] update image
2020-06-20 20:35:19 DEBUG (SyncWorker_3) [custom_components.nwsradar.camera] update image
2020-06-20 20:40:29 DEBUG (SyncWorker_9) [custom_components.nwsradar.camera] update image

I can find logger.set_level under services and effectively inhibit debug messages with the following Service Data entry:

custom_components.nwsradar: critical

For now, logging has been restored to debug as it’s not generating much data. I’ll leave it alone and see if anything misbehaves.

Thanks once again.

i am only able to get the white background style to load with this… i was really hoping for the topographical background like the initial image… has support for that stopped?

Looks good to me, how have you configured it?