technyon / nuki_hub

Use an ESP32 as a Hub between a NUKI Lock and your smarthome.
MIT License
521 stars 40 forks source link

Template variable error: No first item, sequence was empty. when rendering '{{ (value_json|selectattr('type', 'eq', 'LockAction')|selectattr('action', 'in', ['Lock', 'Unlock', 'Unlatch'])|first).authorizationName }}' #243

Closed DEVIDTR closed 10 months ago

DEVIDTR commented 1 year ago

Please also add | default to this template setting as for Keypad Status. It also raises an issue:

Corrected:

{"dev":{"ids":["nuki_30737e6c"],"mf":"Nuki","mdl":"SmartLock","name":"HomeLock"},"\~":"nuki","name":"Keypad status","unique_id":"30737e6c_keypad_stats","stat_t":"~/lock/log","ent_cat":"diagnostic","ic":"mdi:drag-vertical","value_template":"{{ (value_json|selectattr('type', 'eq', 'KeypadAction')|first|default).completionStatus|default }}"}

technyon commented 1 year ago

Check this binary please.

nuki_hub-8.28-pre-1.zip

technyon commented 1 year ago

@DEVIDTR Does this fix the issue for you?

DEVIDTR commented 1 year ago

Yes


Von: Jan-Ole Schümann @.> Gesendet: Saturday, November 4, 2023 4:32:36 AM An: technyon/nuki_hub @.> Cc: Mention @.>; Author @.> Betreff: Re: [technyon/nuki_hub] Template variable error: No first item, sequence was empty. when rendering '{{ (value_json|selectattr('type', 'eq', 'LockAction')|selectattr('action', 'in', ['Lock', 'Unlock', 'Unlatch'])|first).authorizationName }}' (Issue #243)

@DEVIDTRhttps://github.com/DEVIDTR Does this fix the issue for you?

— Reply to this email directly, view it on GitHubhttps://github.com/technyon/nuki_hub/issues/243#issuecomment-1793324078 or unsubscribehttps://github.com/notifications/unsubscribe-auth/AK5OQHSXBZ6VNT66QM5WGJTYCWZNLBFKMF2HI4TJMJ2XIZLTSOBKK5TBNR2WLJDUOJ2WLJDOMFWWLO3UNBZGKYLEL5YGC4TUNFRWS4DBNZ2F6YLDORUXM2LUPGBKK5TBNR2WLJDUOJ2WLJDOMFWWLLTXMF2GG2C7MFRXI2LWNF2HTAVFOZQWY5LFUVUXG43VMWSG4YLNMWVXI2DSMVQWIX3UPFYGLLDTOVRGUZLDORPXI6LQMWWES43TOVSUG33NNVSW45FGORXXA2LDOOJIFJDUPFYGLKTSMVYG643JORXXE6NFOZQWY5LFVE2DOMRZGIYDAMRQQKSHI6LQMWSWS43TOVS2K5TBNR2WLKRRHE3DSMBVG4ZTOMNHORZGSZ3HMVZKMY3SMVQXIZI. You are receiving this email because you were mentioned.

Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.