From bb9ebb113812a3fd7fed05f350447044f04198bc Mon Sep 17 00:00:00 2001 From: archipelago Date: Wed, 22 Jul 2026 05:00:10 -0400 Subject: [PATCH] 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 --- core/archipelago/src/api/rpc/package/pine_ha.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/archipelago/src/api/rpc/package/pine_ha.rs b/core/archipelago/src/api/rpc/package/pine_ha.rs index e5a7b939..dc1efdad 100644 --- a/core/archipelago/src/api/rpc/package/pine_ha.rs +++ b/core/archipelago/src/api/rpc/package/pine_ha.rs @@ -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') }}}}"