R2: git = source de vérité — src/nodes/ + build/extract intégrés au push

- src/nodes/*.js (6 nodes + template snapshot) = source de vérité unique.
- n8n-push.mjs reconstruit le JSON depuis src/ avant syntaxe+golden+PUT
  (src gagne toujours; n8n-extract.mjs pour resynchroniser si édition UI).
- n8n-build.mjs --check pour vérifier la synchro.
- Copies historiques déplacées dans archive/ (mortes, dérivées de la prod).
- .gitignore: backups locaux de rollback.
- AGENTS.md: règle R2 pour toutes les futures sessions (dont Qwen local).
- Validé: idempotence, mutation/restauration, pipeline push complet en réel.
This commit is contained in:
Tallagrand Thierry
2026-08-07 21:03:52 +02:00
parent b10c90c74f
commit 1ae8129658
78 changed files with 5132 additions and 0 deletions

142
archive/snapshot.js Normal file
View File

@@ -0,0 +1,142 @@
{{ {
"soc_percent": states("sensor.victron_battery_soc"),
"battery_current_a": states("sensor.victron_battery_current"),
"pv_power_w": states("sensor.victron_pv_power_system"),
"pv_power_10m_avg_w": states("sensor.victron_pv_power_10m_avg"),
"pv_trend_w": states("sensor.victron_pv_power_trend_w"),
"house_ac_power_w": states("sensor.victron_consumption_power_l1"),
"grid_power_w": states("sensor.victron_grid_power_l1"),
"grid_state": states("switch.edf_general_ok_switch"),
"today_remaining_kwh": states("sensor.energy_production_today_remaining"),
"evcs_device_connected": states("binary_sensor.victron_evcs_device_connected"),
"evcs_vehicle_connected": states("binary_sensor.victron_evcs_vehicle_connected"),
"evcs_status_raw": states("sensor.victron_evcs_status_raw"),
"evcs_mode_sensor": states("sensor.victron_evcs_mode"),
"evcs_mode_fallback": states("input_text.sensor_victron_evcs_mode"),
"evcs_set_current_a": states("sensor.victron_evcs_set_current"),
"evcs_command_current_a": states("number.victron_evcs_set_current_command"),
"evcs_current_a": states("sensor.victron_evcs_current"),
"evcs_ac_power_w": states("sensor.victron_evcs_ac_power"),
"evcs_charging_switch": states("switch.victron_evcs_charging"),
"evcs_auto_start_switch": states("switch.victron_evcs_auto_start"),
"controller_enabled": states("input_boolean.victron_evcs_surplus_auto_enabled"),
"notifications_enabled": states("input_boolean.victron_evcs_surplus_notifications"),
"hard_stop_enabled": states("input_boolean.victron_evcs_hard_stop_enabled"),
"charge_permission_now": states("input_boolean.victron_evcs_charge_permission_now"),
"control_latch": states("input_boolean.victron_evcs_control_latch"),
"departure_priority_enabled": states("input_boolean.victron_evcs_departure_priority_enabled"),
"forecast_mode_enabled": states("input_boolean.victron_evcs_forecast_mode_enabled"),
"target_current_auto_a": states("input_number.victron_evcs_target_current_auto"),
"budget_remaining_kwh": states("input_number.victron_evcs_budget_remaining_kwh"),
"projected_end_soc_after_charge": states("input_number.victron_evcs_projected_end_soc_after_charge"),
"pv_start_min_w": states("input_number.victron_evcs_pv_start_min_w"),
"pv_hold_min_w": states("input_number.victron_evcs_pv_hold_min_w"),
"house_ac_headroom_w": states("input_number.victron_evcs_house_ac_headroom_w"),
"battery_discharge_soft_a": states("input_number.victron_evcs_battery_discharge_soft_a"),
"battery_discharge_hard_a": states("input_number.victron_evcs_battery_discharge_hard_a"),
"battery_reserve_up_a": states("input_number.victron_evcs_battery_reserve_up_a"),
"battery_neutral_band_a": states("input_number.victron_evcs_battery_neutral_band_a"),
"soc_start_min": states("input_number.victron_evcs_soc_start_min"),
"soc_stop_min": states("input_number.victron_evcs_soc_stop_min"),
"current_min_a": states("input_number.victron_evcs_current_min_a"),
"current_max_auto_a": states("input_number.victron_evcs_current_max_auto_a"),
"current_step_up_a": states("input_number.victron_evcs_current_step_up_a"),
"current_step_down_a": states("input_number.victron_evcs_current_step_down_a"),
"current_change_cooldown_seconds": states("input_number.victron_evcs_current_change_cooldown_seconds"),
"min_run_minutes": states("input_number.victron_evcs_min_run_minutes"),
"min_stop_minutes": states("input_number.victron_evcs_min_stop_minutes"),
"required_energy_kwh": states("input_number.victron_evcs_required_energy_kwh"),
"soc_comfort_target": states("input_number.victron_evcs_soc_comfort_target"),
"end_of_day_soc_guard": states("input_number.victron_evcs_end_of_day_soc_guard"),
"base_load_remaining_kwh": states("input_number.victron_base_load_remaining_kwh"),
"flexible_safety_margin_kwh": states("input_number.victron_flexible_safety_margin_kwh"),
"end_of_day_soc_target": states("input_number.victron_end_of_day_soc_target"),
"ac_loads_max_safe_w": states("input_number.victron_ac_loads_max_safe_w"),
"battery_full_soc": states("input_number.victron_evcs_battery_full_soc"),
"battery_full_forecast_min_kwh": states("input_number.victron_evcs_battery_full_forecast_min_kwh"),
"forecast_commit_soc_floor": states("input_number.victron_evcs_forecast_commit_soc_floor"),
"forecast_commit_min_kwh": states("input_number.victron_evcs_forecast_commit_min_kwh"),
"cloud_debt_kwh": states("input_number.victron_evcs_cloud_debt_kwh"),
"cloud_debt_max_kwh": states("input_number.victron_evcs_cloud_debt_max_kwh"),
"cloud_tolerance_minutes": states("input_number.victron_evcs_cloud_tolerance_minutes"),
"cloud_debt_started_at": states("input_datetime.victron_evcs_cloud_debt_started_at"),
"operating_mode_helper": states("input_text.victron_evcs_operating_mode"),
"departure_time": states("input_datetime.victron_evcs_departure_time"),
"last_start_at": states("input_datetime.victron_evcs_last_start_at"),
"last_stop_at": states("input_datetime.victron_evcs_last_stop_at"),
"last_current_change_at": states("input_datetime.victron_evcs_last_current_change_at"),
"day_start_time": states("input_datetime.victron_flexible_day_start_time"),
"day_stop_time": states("input_datetime.victron_flexible_day_stop_time"),
"vebus_overload": states("binary_sensor.victron_ve_bus_overload"),
"vebus_l1_overload": states("binary_sensor.victron_ve_bus_l1_overload"),
"vebus_low_battery": states("binary_sensor.victron_ve_bus_low_battery"),
"vebus_l1_low_battery": states("binary_sensor.victron_ve_bus_l1_low_battery"),
"vebus_ac_out_l1_power_w": states("sensor.victron_ve_bus_ac_out_l1_power"),
"vebus_ac_out_l1_current_a": states("sensor.victron_ve_bus_ac_out_l1_current"),
"vebus_ac_out_l1_voltage_v": states("sensor.victron_ve_bus_ac_out_l1_voltage"),
"vebus_dc_voltage_v": states("sensor.victron_ve_bus_dc_voltage"),
"vebus_dc_current_a": states("sensor.victron_ve_bus_dc_current"),
"vebus_dc_power_w": states("sensor.victron_ve_bus_dc_power_system"),
"vebus_state": states("sensor.victron_ve_bus_state"),
"vebus_main_state": states("sensor.victron_ve_bus_main_state"),
"last_signature": states("input_text.victron_evcs_control_last_signature"),
"hc_night_start_time": states("input_datetime.victron_evcs_hc_night_start"),
"hc_night_stop_time": states("input_datetime.victron_evcs_hc_night_stop"),
"morning_start_time": states("input_datetime.victron_evcs_morning_start"),
"morning_stop_time": states("input_datetime.victron_evcs_morning_stop"),
"hc_midday_start_time": states("input_datetime.victron_evcs_hc_midday_start"),
"hc_midday_stop_time": states("input_datetime.victron_evcs_hc_midday_stop"),
"evening_start_time": states("input_datetime.victron_evcs_evening_start"),
"evening_stop_time": states("input_datetime.victron_evcs_evening_stop"),
"allow_grid_hc_night": states("input_boolean.victron_evcs_allow_grid_hc_night"),
"allow_grid_hc_midday": states("input_boolean.victron_evcs_allow_grid_hc_midday"),
"probe_enabled": states("input_boolean.victron_evcs_probe_enabled"),
"probe_minutes": states("input_number.victron_evcs_probe_minutes"),
"probe_retry_minutes": states("input_number.victron_evcs_probe_retry_minutes"),
"probe_current_a": states("input_number.victron_evcs_probe_current_a"),
"grid_battery_soft_a": states("input_number.victron_evcs_grid_battery_soft_a"),
"grid_battery_hard_a": states("input_number.victron_evcs_grid_battery_hard_a"),
"morning_probe_pv_avg_min_w": states("input_number.victron_evcs_morning_probe_pv_avg_min_w"),
"morning_probe_pv_trend_min_w": states("input_number.victron_evcs_morning_probe_pv_trend_min_w"),
"midday_probe_pv_avg_min_w": states("input_number.victron_evcs_midday_probe_pv_avg_min_w"),
"afternoon_probe_pv_avg_min_w": states("input_number.victron_evcs_afternoon_probe_pv_avg_min_w"),
"afternoon_probe_soc_min": states("input_number.victron_evcs_afternoon_probe_soc_min"),
"afternoon_battery_max_discharge_a": states("input_number.victron_evcs_afternoon_battery_max_discharge_a"),
"morning_soc_min": states("input_number.victron_evcs_morning_soc_min"),
"midday_soc_min": states("input_number.victron_evcs_midday_soc_min"),
"evening_soc_start_min": states("input_number.victron_evcs_evening_soc_start_min"),
"evening_soc_stop_min": states("input_number.victron_evcs_evening_soc_stop_min"),
"morning_battery_max_discharge_a": states("input_number.victron_evcs_morning_battery_max_discharge_a"),
"midday_battery_max_discharge_a": states("input_number.victron_evcs_midday_battery_max_discharge_a"),
"evening_battery_max_discharge_a": states("input_number.victron_evcs_evening_battery_max_discharge_a"),
"last_block_reason": states("input_text.victron_evcs_last_block_reason"),
"blocked_until": states("input_datetime.victron_evcs_blocked_until"),
"probe_started_at": states("input_datetime.victron_evcs_probe_started_at"),
"victron_evcs_strategy": states("input_select.victron_evcs_strategy")
} | tojson }}