cyberjunky / home-assistant-p2000

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

newest update not working (1.0.19) #40

Closed canedje closed 2 years ago

canedje commented 3 years ago

I did just add the newest HACS version. I do not recieve warnings.

My sensor:

#----------------------------------------------------------------      
# Sensoren voor p2000
# Regio 10 = Noord Holland Noord
#----------------------------------------------------------------

- platform: p2000
  name: P2000
  regios: 10,11,12
  disciplines: 1,2,3,4
  radius: 5000
  scan_interval: 10
#  capcodes: 1403001,1403003
  icon: mdi:alarm-light

This worked with the version before. What am I doing wrong?

cyberjunky commented 3 years ago

Try to remove disciplines, did test those yet.

Op zo 13 jun. 2021 19:40 schreef canedje @.***>:

I did just add the newest HACS version. I do not recieve warnings.

My sensor:

----------------------------------------------------------------

Sensoren voor p2000

Regio 10 = Noord Holland Noord

----------------------------------------------------------------

  • platform: p2000 name: P2000 regios: 10,11,12 disciplines: 1,2,3,4 radius: 5000 scan_interval: 10

    capcodes: 1403001,1403003

    icon: mdi:alarm-light

This worked with the version before. What am I doing wrong?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cyberjunky/home-assistant-p2000/issues/40, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJR36PCK2ATTJDMAGN67BTTSTUPHANCNFSM46T57J2A .

canedje commented 3 years ago

I will test (if this is what you ment)

#----------------------------------------------------------------      
# Sensoren voor p2000
# Regio 10 = Noord Holland Noord
#----------------------------------------------------------------

- platform: p2000
  name: P2000
  regios: 10,11,12
#  disciplines: 1,2,3,4
  radius: 5000
  scan_interval: 10
#  capcodes: 1403001,1403003
  icon: mdi:alarm-light

and will come back with the results Thanks for the reply

EDIT: I also removed radius

canedje commented 3 years ago

No, no results unfortunately. Somebody at Apeldoorn has it working I only see the latest warning with the old version: image

I will try only one regio:

#----------------------------------------------------------------      
# Sensoren voor p2000
# Regio 10 = Noord Holland Noord
#----------------------------------------------------------------

- platform: p2000
  name: P2000
#  regios: 10,11,12
  regios: 10
#  disciplines: 1,2,3,4
#  radius: 5000
  scan_interval: 10
#  capcodes: 1403001,1403003
  icon: mdi:alarm-light
cyberjunky commented 3 years ago

@canedje not all messages have lat/lon yet. So perhaps use nolocation: True for the time being... And you have 3 regios but only 5km range, seems a bit odd, only if you live on the central location of the 3 of them...

canedje commented 3 years ago

Yes I changed allready the regios to one and removed the radius (see message above) And will try nolocation true also I first wait for an actual p2000 warning

BebeMischa commented 3 years ago

I have this issue also, and strange, the first sensor works, the other three do not...

sensor:
  - platform: p2000
    name: AMS
    regios: 13
    disciplines: 1,2,3,4
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: True

  - platform: p2000
    name: ZAAN
    regios: 11
    disciplines: 1,2,3,4
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: False

  - platform: p2000
    name: GOOI
    regios: 14
    disciplines: 1,2,3,4
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: False

  - platform: p2000
    name: KNMR
    regios: 12
    disciplines: 1,2,3,4
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: False

image

As you see, the other three sensors do not refresh, contains data from before the old RSS feed was gone.

I did restart HA...

So, it looks, like nolocation: False is a pain.

I will now try to set them all to true, but i'm afraid, that it reintroduces old problem - all 4 sensors will show the same event, when no location is given. I will report, how it goes...

BTW, the first sensor, which does work with the new version, does not write time stamps, a feature, I really liked.

cyberjunky commented 3 years ago

As I wrote above not all messages don't have locations yet in new feed, zo if you have location: false, this means no updates. Also remove disciples for now 1-4 means alle of them anyway, except knot which you never get. This feed is different so the code works different too.

BebeMischa commented 3 years ago

Ok, i've looked specially on the description page, if there are changes, but did not notice any. Thanks for the directions ;-)

cyberjunky commented 3 years ago

Rtfm doesn't apply here :-)

BebeMischa commented 3 years ago

BTW, your coffee is already freezing cold!

BebeMischa commented 3 years ago

Looks better now, but please, give me back my timestamps :-P

But, as I said, now some of the events display for two regio's simultanously, my old irritation is back :-)

image

Code used now:

sensor:
  - platform: p2000
    name: AMS
    regios: 13
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: True

  - platform: p2000
    name: ZAAN
    regios: 11
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: True

  - platform: p2000
    name: GOOI
    regios: 14
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: True

  - platform: p2000
    name: KNMR
    regios: 12
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: True

BTW. do capcode filter still works?

cyberjunky commented 3 years ago

Could it be that some messages spread over 2 adjacent regio's? This because the feed and code are really different now, in the old version region was part of the url, now all messages are received and field regio is scanned for correct one. Capcodes are unique now per event, and in separate field, they should word better , could be that you need the 0 in front (check official capcodes list) and it's not tested yet.

BebeMischa commented 3 years ago

That is nice to hear, as it could finally make possible, what we started earlier, filtering out the Lifeliners, as that second integration never got to a reliable state ;-)

cyberjunky commented 3 years ago

I think I need to make regio's optional for that to function since lifeliners can operate across them. It's possible now since regio's are not part of url any more.

BebeMischa commented 3 years ago

I'm just trying with al regio's listed for that sensor :-)

BebeMischa commented 3 years ago
sensor:
  - platform: p2000
    name: AMS
    regios: 13
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: True

  - platform: p2000
    name: ZAAN
    regios: 11
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: True

  - platform: p2000
    name: GOOI
    regios: 14
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: True

  - platform: p2000
    name: KNMR
    regios: 12
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: True

  - platform: p2000
    name: LIFE
    regios: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
    capcodes: 0120901,1420059,0923993
    scan_interval: 20
    icon: mdi:helicopter
    nolocation: True

results in image

Tomorrow i will test more... Have to go now. ;-) But again, Ron, DANKJEWEL :-)

ernieek commented 3 years ago

I'm stil working on it to get all lon lat filled. So be patiant. Still work in progress 😊

BebeMischa commented 3 years ago

Never mind the timestamps. I found a way, using Logbook card,

image

canedje commented 3 years ago

It is working after adding nolocation: true.

BebeMischa commented 3 years ago

Now i only still doubt, if this is correct:

capcodes: 0120901,1420059,0923993

Or do I need a 0 also by the longer capcode in the middle?

BebeMischa commented 3 years ago

Ok, with more of the capcodes as a oneliner it doe's not work. Maybe there is some syntax error, I'm not sure.

So This doe's not work for me, it does not update:

 - platform: p2000
    name: LIFE
    regios: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
    capcodes: 0120901,1420059,0923993
    scan_interval: 20
    icon: mdi:helicopter
    nolocation: True

But this doe's work fine now, one sensor per capcode:

# Sensors
sensor:
  - platform: p2000
    name: AMS
    regios: 13
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: True

  - platform: p2000
    name: ZAAN
    regios: 11
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: True

  - platform: p2000
    name: GOOI
    regios: 14
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: True

  - platform: p2000
    name: KNMR
    regios: 12
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: True

  - platform: p2000
    regios: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
    name: LIFE1
    capcodes: 0120901
    scan_interval: 20
    icon: mdi:helicopter
    nolocation: True

  - platform: p2000
    name: LIFE2
    regios: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
    capcodes: 1420059
    scan_interval: 20
    icon: mdi:helicopter
    nolocation: True

  - platform: p2000
    name: LIFE3
    regios: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
    capcodes: 0923993
    scan_interval: 20
    icon: mdi:helicopter
    nolocation: True

  - platform: p2000
    name: KNRM Ijmuiden
    regios: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
    capcodes: 1735099
    scan_interval: 20
    icon: mdi:boat
    nolocation: True

And so I finally have exactly, what I wanted. So, @cyberjunky , the second integration, p2000-Lifeliner has become not needed anymore :-)

Result:

image

Guys, you are hero's! 🥇

P.S. And yes, stupid me did corrected the lovelace interface with the correct card for the ZAAN sensor :-)

mobiledude2 commented 3 years ago

It’s great to have data inflow again! Much appreciated. Looking forward to map locations and return of radius! Keep up the great work 👍🏻

cyberjunky commented 3 years ago

@BebeMischa I think capcodes are 7 chars long, so no leading zero if they are already that length, what do you mean with timestamp missing? There is a time attribute still, but you need something else? Will test multiple capcodes, maybe even add support for a capcode file with code and description field?

canedje commented 3 years ago

Yes I forgot to mention. Mobildude2 did already. I'm also very happy that p2000 app is running again. Thanks for the work your doing for this!!

cyberjunky commented 3 years ago

I just found out I use the same event name for all event triggers on the bus, so no wonder the events overwrote each other.

canedje commented 3 years ago

just for info. Your right there are no location values as you metioned: image

cyberjunky commented 3 years ago

There are but not always... being worked on

canedje commented 3 years ago

There are but not always... being worked on

Not pushing here, just for info

ernieek commented 3 years ago

as i said :)

I'm stil working on it to get all lon lat filled. So be patiant. Still work in progress

BebeMischa commented 3 years ago

@BebeMischa I think capcodes are 7 chars long, so no leading zero if they are already that length, what do you mean with timestamp missing? There is a time attribute still, but you need something else? Will test multiple capcodes, maybe even add support for a capcode file with code and description field?

capcodes, if used solo, only one code per sensor, are working fine. And yes, no extra 0 needed for 7chars codes. I've sorted that out already. They just don't work, if used multiple in one line.

So this works:

capcodes: 1735099

And this does not:

capcodes: 0120901,1420059,0923993

With time stamps I mean this. If I use entities in a lovelace card, they do not display timestamps. In following pic the first row is a newly refreshed sensor after the update, it does not display time. The other three are old data before the update. They al have a timestamp.

afbeelding

As I do need to see the time of event, I don't use the entities card, but a Logbook card. The time then is displayed:

afbeelding

Actualy I still will like to see the entities card display timestamp, as that card uses lot less space ;-)

A capcode selector somehow would be nice too, yes ;-)

cyberjunky commented 3 years ago

In 1.0.20 multiple capcodes work it seems

mobiledude2 commented 3 years ago

How do I use "default" ? in disciplines (Optional): Disciplines to display, separate them by commas. (default = all of them)

is it text in the yaml file? ("disciplines: default" or remove it out of the config?

BebeMischa commented 3 years ago

configuration.yaml

if you wan't to select disciplines:

sensor:
  - platform: p2000
    name: AMS
    regios: 13
    disciplines: Ambulance,Brandweer
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: True

If you don't, all disciplines will be collected:

sensor:
  - platform: p2000
    name: AMS
    regios: 13
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: True

I hope, I'm right, as that part has changed yesterday... :-)

mobiledude2 commented 3 years ago

configuration.yaml

if you wan't to select disciplines:

sensor:
  - platform: p2000
    name: AMS
    regios: 13
    disciplines: Ambulance,Brandweer
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: True

If you don't, all disciplines will be collected:

sensor:
  - platform: p2000
    name: AMS
    regios: 13
    scan_interval: 20
    icon: mdi:fire-truck
    nolocation: True

I hope, I'm right, as that part has changed yesterday... :-)

thanks disciplines: Ambulance,Brandweer? or disciplines: Ambulancediensten,Brandweerdiensten

BebeMischa commented 3 years ago

Oh, you see, I need to get used to it too. Yours have to be the correct one :-)

cyberjunky commented 3 years ago

this: disciplines: Ambulancediensten,Brandweerdiensten

But because I don't know all possible options yet (I have seen Kustwacht etc) I wrote 'all of them' Without the option specified there is no filter on it.

mobiledude2 commented 3 years ago

I am really happy this one is starting to work again. I know the owner of this integration is working hard to implement lon/lat and radius. But in the meantime I have a question: since my sensor is from the rijnmond area, my sensor gets a lot of data not relevant for me. Is there maybe a “workaround” to limit the amount of updates by some sort of filtering? Maybe based on text, being the actual city?

dutch-erik commented 3 years ago

I suggest to add: regios: 17 # Rotterdam Rijnmond or contains: Rotterdam # city name

mobiledude2 commented 3 years ago

I suggest to add: regios: 17 # Rotterdam Rijnmond or contains: Rotterdam # city name

contains works for now. Thanks! Can "contains" have multiple items? contains:Rotterdam,Vlaardingen as an example?

Tyrian81 commented 3 years ago
  #====================
  #=== P2000 nooddiensten
  #====================
  - platform: p2000
    name: Hulpdiensten 
    regios: 3
    radius: 15000
    scan_interval: 30
    latitude: x.xxxxx  
    longitude: x.xxxxx

not giving any data ?

cyberjunky commented 2 years ago

Set nolocation = True or install latest version where this is set to default