fix(pine): availability guards on numeric HA voice sensors

Sensors with a unit (sync %, lightning/onchain sats) rendered the string
'None' when bitcoind is early in IBD or LND is down, which HA rejects
with a ValueError on every 30s scan. Mark them unavailable instead; the
intent scripts already speak a fallback for unavailable states.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
archipelago 2026-07-22 05:00:10 -04:00
parent cc2c06c6dc
commit bb9ebb1138

View File

@ -132,6 +132,7 @@ rest:
unique_id: archy_bitcoin_sync
unit_of_measurement: "%"
value_template: "{{{{ value_json.bitcoin.sync_percent }}}}"
availability: "{{{{ value_json.bitcoin.sync_percent is not none }}}}"
- name: "Archy Bitcoin Peers"
unique_id: archy_bitcoin_peers
value_template: "{{{{ value_json.bitcoin.peers }}}}"
@ -142,10 +143,12 @@ rest:
unique_id: archy_lightning_balance
unit_of_measurement: "sats"
value_template: "{{{{ (value_json.lightning or {{}}).get('channel_balance_sats') }}}}"
availability: "{{{{ (value_json.lightning or {{}}).get('channel_balance_sats') is not none }}}}"
- name: "Archy Onchain Balance"
unique_id: archy_onchain_balance
unit_of_measurement: "sats"
value_template: "{{{{ (value_json.lightning or {{}}).get('balance_sats') }}}}"
availability: "{{{{ (value_json.lightning or {{}}).get('balance_sats') is not none }}}}"
- name: "Archy Mesh Message"
unique_id: archy_mesh_message
value_template: "{{{{ (value_json.mesh_message or {{}}).get('id') }}}}"