Toon app: NL-Alert

Forum about forum-provided applications on Toon

Moderators: marcelr, TheHogNL, Toonz

glsf91
Member
Member
Posts: 184
Joined: Fri Sep 15, 2017 9:25 pm

Toon app: NL-Alert

Post by glsf91 »

This app is not working anymore. Please remove it from your Toon

I have made an app to display the NL-Alert messages for Toon1 en Toon2 (tested both). It has the following functionality:

Configuration (Instellingen screen) of:
- location of Toon (latitude, longitude); Also QrCode scan can be used (like buienradar app)
- timeframe (Tijdsduur) where an alert is counted in summary of the Tile
- icon in systray

On the Tile it shows a summary of the number of messages:
- for the messages where your location is inside the NL-Alert area
- for the messages where your location is outside the NL-Alert area
It shows also the status of getting/processing the messages.

When clicking on the Tile you get a screen with scrollable NL-Alert messages.
All messages (maximum 10) for the last 7 days are visible. With a (remembered) Filter button you can show only the messages where your location is inside the Nl-Alert area. Defined timeframe is not used here.
There is also a refresh button which refreshes the messages. It can only be used again after a minute (because of rate limits).
Every 10 minutes the NL-Alert messages are refreshed.

When a NL-Alert message is received where your location is inside the NL-Alert area, a full screen alarm popup is shown with the first NL-Alert message.
You have to acknowledge the alarm. It is shown only once (survives restart).

V1.0.1
Initial release

V1.1.0
Added alarm popup

V1.1.1
Qqrcode timer fix (qrcode timer fix)
(thanks TheHogNL)

V1.1.2
Confirmation that it received the coordinates using the qr code option
(thanks TheHogNL)

V1.2.0
Changed alerting from NL-Alert center to NL-Alert area
Changed Tile and settings

V1.2.1
- debug logging switched off by default

V1.2.3
- moved last alert check file to permanent location so after reboot old alerts are not displayed again

V1.2.4
- fixed old alert is displayed after restart gui because of mistake in permanent file location

V1.2.5
- skip alerts which are more then 7 days old

V1.2.5 is not working anymore because of the datasource had stopped. Upgrade to the next version.

V.1.3.1
- Using now another data source for NL-alert messages.
- Alert location and distance is not available anymore. If you are in the area alarms goes off.

V1.3.2
- Fix failure when <div class="statusoverzicht">ACTIEF</div> is before date string
- change response file from json to html extension

Known issues
Empty thumbnail icon when adding to Tile. Has no influence on app functionality. Is fixed when using firmware 5.25.8 or later.
Last edited by glsf91 on Wed Nov 01, 2023 1:00 pm, edited 23 times in total.
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: NL-Alert

Post by Toonz »

nice idea.
For the configuration (lon/lat coordinates) you can copy code from the buienradar app (BuienradarEditLonLatScreen.qml). This was fully automated by TheHogNL using your mobile phone.
For the thumbnails you can use an existing one from another app or refer to it via an http URL to the local Toon (127.0.0.1).

If you want it in ToonStore just email me the zipfile, I will then upload it to our GitHub from which you can do further maintenance via the git client on Toon.
And publish in ToonStore of course.....
member of the Toon Software Collective
glsf91
Member
Member
Posts: 184
Joined: Fri Sep 15, 2017 9:25 pm

Re: Toon app: NL-Alert

Post by glsf91 »

Toonz wrote:nice idea.
For the thumbnails you can use an existing one from another app or refer to it via an http URL to the local Toon (127.0.0.1).
I want to use my own one if possible. I tried with the following result:
If I try: property url thumbnailIcon: "http://localhost/nl-icon.png"
I get the error: qrc:/apps/homescreen/TileThumbnail.qml:73:3: QML Image: Failed to get image from provider: image://scaled//localhost/nl-icon.png

When using wget I get the icon without any problem.
For example the systray icon it will work, but not for thumbnail (looks like).

Other stuff I will look into.
TerrorSource
Administrator
Administrator
Posts: 494
Joined: Thu May 04, 2017 9:28 pm

Re: Toon app: NL-Alert

Post by TerrorSource »

glsf91 wrote:
Toonz wrote:nice idea.
For the thumbnails you can use an existing one from another app or refer to it via an http URL to the local Toon (127.0.0.1).
I want to use my own one if possible. I tried with the following result:
If I try: property url thumbnailIcon: "http://localhost/nl-icon.png"
I get the error: qrc:/apps/homescreen/TileThumbnail.qml:73:3: QML Image: Failed to get image from provider: image://scaled//localhost/nl-icon.png

When using wget I get the icon without any problem.
For example the systray icon it will work, but not for thumbnail (looks like).

Other stuff I will look into.
What if you use:
http://127.0.0.1/hdrv_zwave/file.txt for example?

Saw that Toonz used that for DomoticzBoard testing :)

Can you put the app on Github ? If it's finished we can fork the repo it into the TSC github
glsf91
Member
Member
Posts: 184
Joined: Fri Sep 15, 2017 9:25 pm

Re: Toon app: NL-Alert

Post by glsf91 »

TerrorSource wrote: What if you use:
http://127.0.0.1/hdrv_zwave/file.txt for example?

Saw that Toonz used that for DomoticzBoard testing :)

Can you put the app on Github ? If it's finished we can fork the repo it into the TSC github
Even with wget not working on the Toon it self. wget http://127.0.0.1/hdrv_zwave/file.txt gives:
--2020-03-13 17:34:22-- http://127.0.0.1/hdrv_zwave/file.txt
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2020-03-13 17:34:22 ERROR 404: Not Found.

Maybe first without thumbnail and wait until it is in the resourcefile.

I will (try) putting it on github.
TerrorSource
Administrator
Administrator
Posts: 494
Joined: Thu May 04, 2017 9:28 pm

Re: Toon app: NL-Alert

Post by TerrorSource »

I've tried, exactly the same issue with "thumbnailIcon".

Send me an email with your icons and i will create a test resourcefile for you.
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Toon app: NL-Alert

Post by TheHogNL »

To get it on toonstore first you need to have it on your github and we will fork it to the TSC repository.

Look at the calendar app for example which files/dirs you need to have on the github for your app. https://github.com/ToonSoftwareCollective/calendar

And an idea, look at the smokedetector native app how they overwrite the full screen when smoke is detected. You can use that code to post a NL-alert message
Member of the Toon Software Collective
glsf91
Member
Member
Posts: 184
Joined: Fri Sep 15, 2017 9:25 pm

Re: Toon app: NL-Alert

Post by glsf91 »

TheHogNL wrote:To get it on toonstore first you need to have it on your github and we will fork it to the TSC repository.

Look at the calendar app for example which files/dirs you need to have on the github for your app. https://github.com/ToonSoftwareCollective/calendar

And an idea, look at the smokedetector native app how they overwrite the full screen when smoke is detected. You can use that code to post a NL-alert message
I have created a repository here: https://github.com/glsf91/nlalert

I have the following questions:

I see also a versions.txt and an qmldir file. Do I also have to create this files in my repository?
And which lines do I have to add in qmldir (I don't know what this file is doing)?
If I look at other apps I see differences in which file is included in qmldir. So maybe somebody can explain this.

In toonstore_AppRepository I see also screenshots of the apps. How can I make and supply these or are the Toon" guys" are making this?

I had also sended an email to @Toonz yesterday with this informations/ questions.

I will take a look at your idea.
TerrorSource
Administrator
Administrator
Posts: 494
Joined: Thu May 04, 2017 9:28 pm

Re: Toon app: NL-Alert

Post by TerrorSource »

glsf91 wrote:
TheHogNL wrote:To get it on toonstore first you need to have it on your github and we will fork it to the TSC repository.

Look at the calendar app for example which files/dirs you need to have on the github for your app. https://github.com/ToonSoftwareCollective/calendar

And an idea, look at the smokedetector native app how they overwrite the full screen when smoke is detected. You can use that code to post a NL-alert message
I have created a repository here: https://github.com/glsf91/nlalert

I have the following questions:

I see also a versions.txt and an qmldir file. Do I also have to create this files in my repository?
And which lines do I have to add in qmldir (I don't know what this file is doing)?
If I look at other apps I see differences in which file is included in qmldir. So maybe somebody can explain this.

In toonstore_AppRepository I see also screenshots of the apps. How can I make and supply these or are the Toon" guys" are making this?

I had also sended an email to @Toonz yesterday with this informations/ questions.

I will take a look at your idea.
versions is ToonStore requirement to track version history when you press the ? in the ToonStore.
i'm not sure about the qmldir file.

Easiest for us is that you add the screenshots yourself via a Pull Request, then we only need to check and approve it.

I've send a custom made resoucefile to you so you can test with your images.
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: NL-Alert

Post by Toonz »

glsf91 wrote:In toonstore_AppRepository I see also screenshots of the apps. How can I make and supply these or are the Toon" guys" are making this?
We use the x11vnc app for this. On a Toon 1 you can fully operate a Toon 1 remotely.
Unfortunately on a Toon 2 only the viewing functionality works (due to the multi-touchscreen of the Toon 2 which is not supported by x11vnc).
But I am happy to add the screenshots for you when the production version is ready.
member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: NL-Alert

Post by Toonz »

glsf91 wrote:And which lines do I have to add in qmldir (I don't know what this file is doing)?
Explanation: https://doc.qt.io/qt-5/qtqml-modules-qmldir.html
member of the Toon Software Collective
glsf91
Member
Member
Posts: 184
Joined: Fri Sep 15, 2017 9:25 pm

Re: Toon app: NL-Alert

Post by glsf91 »

Toonz wrote:
glsf91 wrote:And which lines do I have to add in qmldir (I don't know what this file is doing)?
Explanation: https://doc.qt.io/qt-5/qtqml-modules-qmldir.html
I have read this. But I'am not sure it is really used because there is no corresponding import in my files. But maybe my understanding is wrong.
I also saw differences in using this file between several apps.
But I have added it. Also with version en Changelog files.

So I think I'am ready with this. I also made screenshots and made a pull request for toonstore_AppRepository. Also made pull request for adding 2 images to tsc-images. Update for resourcefile is only (for now) for the thumbnail icon, so not in a hurry for me.
Hopefully done everything in the right way.

Now it up to your guys I think (and hope :lol: ).
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: NL-Alert

Post by Toonz »

Hi glsf91,

I forked your GitHub repository and merged your pull requests.
The app is available now in the ToonStore test environment for review.

Working fine, just haven't seen a new alert coming in yet.
One comment: The image on the tile in dim state is now showing colors which is against the 'standards' of Quby.
Can you make that one black & white (greyscale)?

Minor detail: the screenshot of the tile should have the same size as a normal screenshot, otherwise the ToonStore will stretch it to full screen

But a great job :-) !!

Kind regardz,

Toonz
member of the Toon Software Collective
glsf91
Member
Member
Posts: 184
Joined: Fri Sep 15, 2017 9:25 pm

Re: Toon app: NL-Alert

Post by glsf91 »

Thanks.

Luckily I'am not working for Quby :lol:
I liked the color on the Dim Tile but will try to change it.

I will look into you points, probable tomorrow.

Edit 15-3
I have changed the Tile image and screenshot and made a new version of the app and some pull requests
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Toon app: NL-Alert

Post by Toonz »

glsf91 wrote: Edit 15-3
I have changed the Tile image and screenshot and made a new version of the app and some pull requests
Hi glsf91,

All changes processed.
The app is now available in the ToonStore for everyone (version 1.0.1).

Note that the thumbnail icon will be included in the first next release of the resourcefiles.
Therefore currently not showing the icon when adding the nlalert tile to your homescreen, this doesn't impact the app itself.

N.B. The app passed the WAF challenge over here ;-)

Kind regardz,

Toonz
member of the Toon Software Collective
Post Reply

Return to “Toon Apps”