From 8abfae405a56df6a49eee6db7568c8c0df5457b2 Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Thu, 19 Jun 2025 19:24:33 +0200 Subject: [PATCH] Odin: smart ir custom code --- flake.nix | 9 +++++++-- instances/odin/configuration.nix | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index c944fe7..fa6ee04 100644 --- a/flake.nix +++ b/flake.nix @@ -258,6 +258,10 @@ rev = "6f8cac1"; hash = "sha256-5Ulb3z46bfIzztHTMNg/Vc26ru9K40242AsW37TLE18="; }; + code = super.fetchurl { + url = "https://gist.githubusercontent.com/bertof/d2a4af6243300b9ba05638af9a29fa6d/raw/6dbb21db986db15f69bb3040585419a270693289/50.json"; + sha256 = "sha256-9564yMudzY8Z9RzvLqJxuV4k6PLBVJdph71BOz6OXRc="; + }; patcher = super.fetchurl { url = "https://gist.githubusercontent.com/svyatogor/7839d00303998a9fa37eb48494dd680f/raw/66cba20e653f84aab0b9a31ea5b9ca497d038d8a/broadlink_to_tuya.py"; @@ -265,8 +269,9 @@ }; postPatch = '' - # ${super.python312}/bin/python3 ${patcher} codes/climate/1946.json > codes/climate/50.json - sed 's/Broadlink/MQTT/' codes/climate/1946.json > codes/climate/50.json + ${super.python312}/bin/python3 ${patcher} codes/climate/1946.json > codes/climate/50.json + # sed 's/Broadlink/MQTT/' codes/climate/1946.json > codes/climate/50.json + # cp ${code} codes/climate/50.json ''; }); diff --git a/instances/odin/configuration.nix b/instances/odin/configuration.nix index e56e2d4..711e471 100644 --- a/instances/odin/configuration.nix +++ b/instances/odin/configuration.nix @@ -349,9 +349,9 @@ in name = "Climatizzatore"; unique_id = "climatizzatore"; device_code = 50; - controller_data = "zigbee2mqtt/Telecomando corridoio/command"; - temperature_sensor = "sensor.tz3000_fllyghyj_ts0201_temperature"; - humidity_sensor = "sensor.tz3000_fllyghyj_ts0201_humidity"; + controller_data = "zigbee2mqtt/Telecomando corridoio/set/ir_code_to_send"; + temperature_sensor = "sensor.termometro_corridoio_temperature"; + humidity_sensor = "sensor.termometro_corridoio_humidity"; power_sensor = "binary_sensor.climatizzatore_acceso"; power_sensor_restore_state = true; }];