########## Routeur Solaire Triphasé Lite ##########
## V2.2
sensor:
  - name: "Firmware Version"
    unique_id: "RSolaire.firmware_Version"
    icon: mdi:progress-check
    state_topic: "RouteurSolaire/out/Version"
    device:
      identifiers: ["routeur_solaire"]
      name: "Routeur Solaire"
      manufacturer: "Laurent Super"
      model: "Triphasé"

  - name: "Adresse IP"
    unique_id: "RSolaire.IP"
    icon: mdi:ip
    state_topic: "RouteurSolaire/out/IP"
    device:
      identifiers: ["routeur_solaire"]
      name: "Routeur Solaire"
      manufacturer: "Laurent Super"
      model: "Triphasé"

  - name: "Tension Phase 1"
    unique_id: "RSolaire.Tension1"
    unit_of_measurement: "V"
    state_class: measurement
    device_class: voltage
    state_topic: "RouteurSolaire/out/Tension_Phase1"
    device:
      identifiers: ["routeur_solaire"]

  - name: "Tension Phase 2"
    unique_id: "RSolaire.Tension2"
    unit_of_measurement: "V"
    state_class: measurement
    device_class: voltage
    state_topic: "RouteurSolaire/out/Tension_Phase2"
    device:
      identifiers: ["routeur_solaire"]      

  - name: "Tension Phase 3"
    unique_id: "RSolaire.Tension3"
    unit_of_measurement: "V"
    state_class: measurement
    device_class: voltage
    state_topic: "RouteurSolaire/out/Tension_Phase3"
    device:
      identifiers: ["routeur_solaire"]

  - name: "EDF"
    unique_id: "RSolaire.EDF"
    unit_of_measurement: "W"
    state_class: measurement
    device_class: power
    state_topic: "RouteurSolaire/out/EDF"
    device:
      identifiers: ["routeur_solaire"]

  - name: "EDF Phase 1"
    unique_id: "RSolaire.EDF_Phase1"
    unit_of_measurement: "W"
    state_class: measurement
    device_class: power
    state_topic: "RouteurSolaire/out/EDF_Phase1"
    device:
      identifiers: ["routeur_solaire"]

  - name: "EDF Phase 2"
    unique_id: "RSolaire.EDF_Phase2"
    unit_of_measurement: "W"
    state_class: measurement
    device_class: power
    state_topic: "RouteurSolaire/out/EDF_Phase2"
    device:
      identifiers: ["routeur_solaire"]      

  - name: "EDF Phase 3"
    unique_id: "RSolaire.EDF_Phase3"
    unit_of_measurement: "W"
    state_class: measurement
    device_class: power
    state_topic: "RouteurSolaire/out/EDF_Phase3"
    device:
      identifiers: ["routeur_solaire"] 

  - name: "EDF Consommation Energie"
    unique_id: "RSolaire.EDFConso_kWh"
    unit_of_measurement: "kWh"
    state_class: total_increasing
    device_class: energy
    state_topic: "RouteurSolaire/out/EDFConso_kWh"
    device:
      identifiers: ["routeur_solaire"]

  - name: "EDF Injection Energie"
    unique_id: "RSolaire.EDFInjec_kWh"
    unit_of_measurement: "kWh"
    state_class: total_increasing
    device_class: energy
    state_topic: "RouteurSolaire/out/EDFInjec_kWh"
    device:
      identifiers: ["routeur_solaire"]

  - name: "Consigne Variateur 1"
    unique_id: "RSolaire.ConsigneVar1"
    unit_of_measurement: "%"
    state_class: measurement
    state_topic: "RouteurSolaire/out/ConsigneVar1"
    device:
      identifiers: ["routeur_solaire"]

  - name: "Consigne Variateur 2"
    unique_id: "RSolaire.ConsigneVar2"
    unit_of_measurement: "%"
    state_class: measurement
    state_topic: "RouteurSolaire/out/ConsigneVar2"
    device:
      identifiers: ["routeur_solaire"]

  - name: "Offset EDF"
    unique_id: "RSolaire.OffsetEDF"
    unit_of_measurement: "W"
    state_topic: "RouteurSolaire/out/OffsetEDF"
    device:
      identifiers: ["routeur_solaire"]

switch:
  - name: "Forcage Variateur 1"
    unique_id: "forcage_var1"
    command_topic: "RouteurSolaire/in/ForcageVar1"
    state_topic: "RouteurSolaire/out/ForcageVar1"
    payload_on: "1"
    payload_off: "0"
    optimistic: false
    qos: 1
    retain: true
    device:
      identifiers: ["routeur_solaire"]

  - name: "Forcage Variateur 2"
    unique_id: "forcage_var2"
    command_topic: "RouteurSolaire/in/ForcageVar2"
    state_topic: "RouteurSolaire/out/ForcageVar2"
    payload_on: "1"
    payload_off: "0"
    optimistic: false
    qos: 1
    retain: true
    device:
      identifiers: ["routeur_solaire"]

  - name: "Arret Variateur 1"
    unique_id: "arret_var1"
    command_topic: "RouteurSolaire/in/ArretVar1"
    state_topic: "RouteurSolaire/out/ArretVar1"
    payload_on: "1"
    payload_off: "0"
    optimistic: false
    qos: 1
    retain: true
    device:
      identifiers: ["routeur_solaire"]

  - name: "Arret Variateur 2"
    unique_id: "arret_var2"
    command_topic: "RouteurSolaire/in/ArretVar2"
    state_topic: "RouteurSolaire/out/ArretVar2"
    payload_on: "1"
    payload_off: "0"
    optimistic: false
    qos: 1
    retain: true
    device:
      identifiers: ["routeur_solaire"]

  - name: "Afficher Unité"
    unique_id: "Afficher_unite"
    command_topic: "RouteurSolaire/in/AfficherUnite"
    state_topic: "RouteurSolaire/in/AfficherUnite"
    payload_on: "1"
    payload_off: "0"
    optimistic: false
    qos: 1
    retain: true
    device:
      identifiers: ["routeur_solaire"]

  - name: "Priorité Variateur N°2"
    unique_id: "PrioVar2"
    icon: mdi:swap-horizontal
    command_topic: "RouteurSolaire/in/PrioVar2"
    state_topic: "RouteurSolaire/out/PrioVar2"
    payload_on: "1"
    payload_off: "0"
    optimistic: false
    qos: 1
    retain: true
    device:
      identifiers: ["routeur_solaire"]

number:
  - name: "Offset EDF"
    unique_id: "OffsetEDF"
    icon: mdi:arrow-oscillating
    command_topic: "RouteurSolaire/in/OffsetEDF"
    state_topic: "RouteurSolaire/out/OffsetEDF"
    qos: 1
    retain: true
    min: -500
    max: 500
    step: 50
    device:
      identifiers: ["routeur_solaire"]

  - name: "Consigne Max Variateur N°1"
    unique_id: "CmaxVar1"
    icon: mdi:arrow-oscillating
    command_topic: "RouteurSolaire/in/CmaxVar1"
    state_topic: "RouteurSolaire/out/CmaxVar1"
    qos: 1
    retain: true
    min: 20
    max: 100
    step: 10
    unit_of_measurement: "%"
    device:
      identifiers: ["routeur_solaire"]

  - name: "Consigne Max Variateur N°2"
    unique_id: "CmaxVar2"
    icon: mdi:arrow-oscillating
    command_topic: "RouteurSolaire/in/CmaxVar2"
    state_topic: "RouteurSolaire/out/CmaxVar2"
    qos: 1
    retain: true
    min: 20
    max: 100
    step: 10
    unit_of_measurement: "%"
    device:
      identifiers: ["routeur_solaire"]

  - name: "Gain Proportionnel Variateur N°1"
    unique_id: "GainPVar1"
    icon: mdi:chart-line
    command_topic: "RouteurSolaire/in/GainPVar1"
    state_topic: "RouteurSolaire/out/GainPVar1"
    qos: 1
    retain: true
    min: 1
    max: 20
    step: 1
    device:
      identifiers: ["routeur_solaire"]

  - name: "Gain Proportionnel Variateur N°2"
    unique_id: "GainPVar2"
    icon: mdi:chart-line
    command_topic: "RouteurSolaire/in/GainPVar2"
    state_topic: "RouteurSolaire/out/GainPVar2"
    qos: 1
    retain: true
    min: 1
    max: 20
    step: 1
    device:
      identifiers: ["routeur_solaire"]

button:
  - name: "Redémarrage Routeur Solaire"
    unique_id: "restart_routeur_solaire"
    command_topic: "RouteurSolaire/in/Restart"
    payload_press: "1"
    qos: 1
    retain: false
    device:
      identifiers: ["routeur_solaire"]