cyberjunky / home-assistant-p2000

:fire_engine: This component tracks P2000 emergency events in The Netherlands.
MIT License
55 stars 9 forks source link

radius parameter always needed, even with capcodes: ? #7

Closed spiralshapeturtle closed 4 years ago

spiralshapeturtle commented 4 years ago

Love the integration, welldone!

Its a bit confusing that the radius parameter still/always seems to be relevant in receiving messages, when you filter for capcodes only.

When filtering for one or more capcodes, in my opinion the radius should not be taken into account.

The workarround for now is defining the radius parameter at 200km.

cyberjunky commented 4 years ago

I guess it's better to make it optional indeed. I was also looking atusing Zones instead, not sure whats best.

spiralshapeturtle commented 4 years ago

How should the zone's work? It think you have 2 usergroups:

-" scannerluisteraars". just reading the messages around their home displaying in homeassist. -capcode filters, who uses this trigger to enable other automations in homeassist

I think radius is fine, because everyone can configure exactly the range of messages around him. Its a very user friendly format, zone's could also refer to "regio's"?

The capcode filter should overrule/disable the radius setting, there is no need for a radius when capcodes are used

spiralshapeturtle commented 4 years ago

Er zit nog een foutje in je voorbeeld configuration.yaml tussen de capcodes hoort geen spatie te staan;)

cyberjunky commented 4 years ago

Ik heb zojuist 1.0.8 uitgegeven, welke wat issues zou moeten fixen.

spiralshapeturtle commented 4 years ago

Cool wat heb je zoal aangepast, dan kan ik daar specifiek op testen voor je?

cyberjunky commented 4 years ago

Je kunt nu radius weglaten om alles te laten zien (voor capcodes) En heb code aangepast en gehecked op correcte syntax, eigenlijk moet alles weer even gechecked worden ;-)

On Tue, Mar 3, 2020 at 7:10 PM rodeho notifications@github.com wrote:

Cool wat heb je zoal aangepast, dan kan ik daar specifiek op testen voor je?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cyberjunky/home-assistant-p2000/issues/7?email_source=notifications&email_token=ABJR36JZPJ4OTFVJ3OUG653RFVBZXA5CNFSM4K3HEWOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENURQKI#issuecomment-594090025, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJR36KH3TBEE7FOPOYZFRLRFVBZXANCNFSM4K3HEWOA .

spiralshapeturtle commented 4 years ago

Aha cool de radius kan eruit, dat ga ik even testen.

Ik liep gisteren nog tegen het feit aan dat als je twee sensoren hebt gemaakt, bv één monitorcode en één capcode van je eigen dorp. Dat hij dan altijd de laagste numerieke capcode pakt (monitor), en dat je dan nooit een sensor verandering krijgt in de dorp sensor. Dat is misschien nog wel leuk ter overdenking of dat te optimaliseren is door alle capcodes te verzamelen en pas aan het einde te verdelen over de sensoren. (gaat alleen om capcode filters, ik doe niets met radius en gps )

spiralshapeturtle commented 4 years ago

@cyberjunky wil jij deze config eens proberen, blijft bij mij angstig stil. Zeker op de onderste.

sensor:

cyberjunky commented 4 years ago

It looks like a bug, investigating

2020-03-04 15:13:17 DEBUG (MainThread) [custom_components.p2000.sensor] 50 entries downloaded
2020-03-04 15:13:17 DEBUG (MainThread) [custom_components.p2000.sensor] New emergency event found.
2020-03-04 15:13:17 DEBUG (MainThread) [custom_components.p2000.sensor] Calculated distance 25829 meters, max. range 200000 meters
2020-03-04 15:13:17 DEBUG (MainThread) [custom_components.p2000.sensor] New emergency event found.
2020-03-04 15:13:17 DEBUG (MainThread) [custom_components.p2000.sensor] Calculated distance 25829 meters, max. range 200000 meters
cyberjunky commented 4 years ago

Sorry for the bugs, can you test Release 1.0.9? Just copy the latest sensor.py file, or wait for HACS to pickup update to show up.

spiralshapeturtle commented 4 years ago

Hi I think it just picked 1.0.9 from the HACS store, lets test.

spiralshapeturtle commented 4 years ago

Het lijkt erop dat de eerste sensor niet aangesproken wordt, hij vergeet dan de capcode search te starten. Dat is bijzonder want deze sensor loopt altijd mee, tenzij hij blijkbaar gehit wordt dan start de search for capcode niet.

Ik heb de full log, kan ik die via PB met je delen?

sensor:

2020-03-10 12:27:34 DEBUG (MainThread) [custom_components.p2000.sensor] 50 entries downloaded
2020-03-10 12:27:34 DEBUG (MainThread) [custom_components.p2000.sensor] New emergency event found.
2020-03-10 12:27:34 DEBUG (MainThread) [custom_components.p2000.sensor] P 1 Ongeval (beknelling) Waterlinieweg Li 3,9 Utrecht 094631
Tue, 10 Mar 2020 12:25:58 +0100

2020-03-10 12:27:34 DEBUG (MainThread) [custom_components.p2000.sensor] New emergency event found.
2020-03-10 12:27:34 DEBUG (MainThread) [custom_components.p2000.sensor] P 1 Ongeval (beknelling) Waterlinieweg Li 3,8 Utrecht 090571
Tue, 10 Mar 2020 12:26:46 +0100

2020-03-10 12:27:34 DEBUG (MainThread) [custom_components.p2000.sensor] New emergency event found.
2020-03-10 12:27:34 DEBUG (MainThread) [custom_components.p2000.sensor] P 1 Ongeval (beknelling) Waterlinieweg Li 3,8 Utrecht 098591
Tue, 10 Mar 2020 12:27:00 +0100

Neem ik een willekeurige andere melding, dan zie je de search netjes meelopen.

2020-03-10 12:44:50 DEBUG (MainThread) [custom_components.p2000.sensor] 50 entries downloaded
2020-03-10 12:44:50 DEBUG (MainThread) [custom_components.p2000.sensor] New emergency event found.
2020-03-10 12:44:50 DEBUG (MainThread) [custom_components.p2000.sensor] P 3 (melding vervalt) Ongeval (beknelling) Waterlinieweg Li 3,8 Utrecht
Tue, 10 Mar 2020 12:28:28 +0100

2020-03-10 12:44:50 DEBUG (MainThread) [custom_components.p2000.sensor] New emergency event found.
2020-03-10 12:44:50 DEBUG (MainThread) [custom_components.p2000.sensor] P 1 OMS-Alarm WC Het Rond Parkeergarage Stellingmolen Houten 091831
Tue, 10 Mar 2020 12:44:26 +0100

2020-03-10 12:44:50 DEBUG (MainThread) [custom_components.p2000.sensor] Searching for capcode 706440 in 709561 BRW Utrechts Land ( Monitorcode District Binnensticht-Lekstroom )
706951 BRW Houten-West ( Kazernetechniek )
706948 BRW Houten ( Korpsalarm )
706001 BRW Utrechts Land ( Monitorcode )

2020-03-10 12:44:50 DEBUG (MainThread) [custom_components.p2000.sensor] Didn't find capcode 706440, skip.
2020-03-10 12:44:50 DEBUG (MainThread) [custom_components.p2000.sensor] Searching for capcode 706445 in 709561 BRW Utrechts Land ( Monitorcode District Binnensticht-Lekstroom )
706951 BRW Houten-West ( Kazernetechniek )
706948 BRW Houten ( Korpsalarm )
706001 BRW Utrechts Land ( Monitorcode )

2020-03-10 12:44:50 DEBUG (MainThread) [custom_components.p2000.sensor] Didn't find capcode 706445, skip.
2020-03-10 12:44:50 DEBUG (MainThread) [custom_components.p2000.sensor] Searching for capcode 709353 in 709561 BRW Utrechts Land ( Monitorcode District Binnensticht-Lekstroom )
706951 BRW Houten-West ( Kazernetechniek )
706948 BRW Houten ( Korpsalarm )
706001 BRW Utrechts Land ( Monitorcode )

2020-03-10 12:44:50 DEBUG (MainThread) [custom_components.p2000.sensor] Didn't find capcode 709353, skip.
2020-03-10 12:44:50 DEBUG (MainThread) [custom_components.p2000.sensor] Searching for capcode 709354 in 709561 BRW Utrechts Land ( Monitorcode District Binnensticht-Lekstroom )
706951 BRW Houten-West ( Kazernetechniek )
706948 BRW Houten ( Korpsalarm )
706001 BRW Utrechts Land ( Monitorcode )
cyberjunky commented 4 years ago

Ik heb alles al zo'n beetje gefixed, zal die versie zo uploaden. Als je een grote regio met veel events scanned, moet je wel de scantijd lager zetten, anders krijg je meerdere events tegelijk binnen en mis je er, zie je alleen de laatste

Dat laatste moet ik nog fixen, maar dat zit er al een tijdje in. Wellicht moet het design terug naar event triggers, ipv sensor, maar dat zoek ik nog uit.

cyberjunky commented 4 years ago

Try release 1.0.10 it should show up soon in HACS, or copy from github.

spiralshapeturtle commented 4 years ago

Ron wat adviseer jij als scan tijden met de gedeelde configuratie van hierboven? Er vanuit gaande dat het fijn is dat het licht binnen 10 seconden aan is;-) De regio monitor mag er veel langer over doen, maar de lichtschakeling zo kort mogelijk, binnen de beperkingen?

Ik denk dat een een trigger voor de lichtschakeling van HUE wel fijner werkt.

cyberjunky commented 4 years ago

10 seconden?

spiralshapeturtle commented 4 years ago

It seems to be working all fine now! Great work, I'll test in the upcoming days. Still double messages, but that's okey.

image
cyberjunky commented 4 years ago

You can also install release 1.0.11 as see how that works, it filters non location msgs by default.

spiralshapeturtle commented 4 years ago

do you mean "filters" like drop it when there is no GPS coordinate?

cyberjunky commented 4 years ago

Yes. But you can still see them if you set "nolocation: True" in config.

cyberjunky commented 4 years ago

Closing, if there are still problems with latest release please open a new github issue.