I’m trying to get the text from a weather alert. I have done it with other sensors that have numbers as the attribute but unable to get the blob of text.
Blockquote
Entity: sensor.pws_alerts
State: 1
Attributes:
attribution: Data provided by the WUnderground weather service
Date: April 3, 2018
Description: Special Weather Statement
Expires: 7:54 AM EDT on April 04, 2018
Message: Special Weather Statement issued by Environment. 11:55 AM EDT Tuesday 03 April 2018.
Hazardous winter conditions are expected.
Major winter storm tonight and Wednesday.
A winter storm will bring a widespread snowfall totals of 15 to 30 cm by late Wednesday. Strong and gusty northerly winds are expected to whip up the freshly fallen snow especially on Wednesday, with frequent very low visibility in blowing snow in exposed areas possible.
Motorists should be prepared for hazardous winter driving conditions.
There remains some uncertainty as to the exact track of this low pressure system. Even a small shift in the track of the low pressure system could have a large impact on how much snow falls at a given location.
Surfaces such as highways, roads, walkways and parking lots may become difficult to navigate due to accumulating snow. Visibility will be suddenly reduced to near zero at times in heavy snow and blowing snow.
Winter storm warnings are issued when multiple types of severe winter weather are expected to occur together.
Please continue to monitor alerts and forecasts issued by Environment Canada. To report severe weather, send an email to [email protected] or tweet reports using #ONStorm.
expires_epoch:1522842874
friendly_name: Alerts
icon: mdi:alert-circle-outline
I don’t think there is any home assistant object that can store that entire string to pass around. I believe the limit for sensors is 256 characters. I don’t know what it is in other area’s but I would assume it wouldn’t be large.
With that in mind, your best option would be a custom component or AppDaemon.
I’m just starting with appdaemon/hadsahboard(yesterday) so even more lost there. If you could point in the right direction would be happy to give it a shot.
I’d start with learning a bit of the basics for python code. Brush up on all the python object types like int, float, string, unicode, list, dict, etc…
Once you get those down, learn for loops and if statements.
With all that, you should be good enough to read someone else’s code and somewhat figure out what they are doing.
A good place to start directly with appdaemon is right here on the forums. There is a appdaemon filter for the forums because it’s so widely used. There are plenty of people, like myself, who will help you debug code if you paste it there:
Thanks I will look at that post. I use to be a programmer (professionally) but as I got older my mind will not retain new knowledge(or old for that matter) so every day is a learning day.
Now what I would like is a box that pops up on top of the displayed dashboard with a dismiss button, or just touching it to dismiss it. On all dashboards.
Also a quick question does ! work the same as # for comments? Part of that line is from an example.
I haven’t dealt with the dashboard yet. But looking at that would make me assume it’s a keyword to denote that the widget_style is required. I’m probably wrong.
@aimc might know better. Do you know what the ! is for in the widget_style line?