ParadoxAlarmInterface / pai

Paradox Magellan, Spectra and EVO, with MQTT, Signal, Pushbullet, Pushover and others
https://gitter.im/paradox-alarm-interface
Eclipse Public License 2.0
358 stars 94 forks source link

User Tags on Readers #338

Open FigJam23 opened 1 year ago

FigJam23 commented 1 year ago

Feature description

If I use tag to unlock my door Pai logs below output. Anyone know how I can grab and use the data from users in below PAI log.

paradox/events/raw={"additional_data": {"door": 129}, "change": {}, "id": 1, "key": "user,Master Mike,", "label": "Master Mike", "label_type": "b'\\x01'", "level": "INFO", "major": 62, "message": "None access granted to user Master Mike", "minor": 1, "minor2": 129, "module": "b'\\x00$0\\xd7'", "name": "Master Mike", "partition": 0, "tags": ["access", "granted"], "timestamp": "2022-12-29T12:52:00", "type": "user"}

yozik04 commented 1 year ago

It is a regular json. Just parse it.

FigJam23 commented 1 year ago
Something like this, lol I'm sorry I'm no expert 
in json ....
FigJam23 commented 1 year ago

The above works in a sensor but produces everything in the value Key I've tryed this one below but get nothing any pointers would be appreciated.

`

FigJam23 commented 1 year ago

Converted the json to a Easy to read yaml format. Still unsure how to target spicific data like users


additional_data:
  door: 129
change: {}
id: 1
key: user,Master Mike,
label: Master Mike
label_type: b'\x01'
level: INFO
major: 62
message: None access granted to user Master Mike
minor: 1
minor2: 129
module: b'\x00$0\xd7'
name: Master Mike
partition: 0
tags:
  - access
  - granted
timestamp: '2022-12-29T12:52:00'
type: user
yozik04 commented 1 year ago

Search gave me this example: https://github.com/ParadoxAlarmInterface/pai/issues/160#issuecomment-711439532

I am not experienced enough in home assistant templates to help you myself.

Just look for “json” in project issues, there were some solutions.

yozik04 commented 1 year ago

Do not forget to post the solution for others :)

FigJam23 commented 1 year ago

Do not forget to post the solution for others :)

Thanks, Mate that definitely helped https://github.com/ParadoxAlarmInterface/pai/issues/160#issuecomment-711439532

So far I got this working fairly well still working on refining but ill post now to maybe help others. I don't really know what I'm doing but managed to get this far I'll probably add ( door locked on a timer alert ) and some others soon. definitely good to know we can do this as I can now capture anything from those log file outputs yay .

################# Notify Who opened the door # 129 with prox tag ###################### `

pai