sensor:
  # Routeur Solaire #####################################
  - name: "RSolaire.firmwareVersion"
    unique_id: "RSolaire.firmwareVersion"
    state_topic: "RouteurSolaire/out/Version"
    device:
      identifiers: ["routeur_solaire"]
      name: "Routeur Solaire"
      manufacturer: "Laurent Super"
      model: "Monophasé MQTT"

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

  - name: "RSolaire.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: "RSolaire.EDFConso_kWh"
    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: "RSolaire.EDFInjec_kWh"
    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: "RSolaire.ProdSolaire"
    unique_id: "RSolaire.ProdSolaire"
    unit_of_measurement: "W"
    state_class: measurement
    device_class: power
    state_topic: "RouteurSolaire/out/ProdSolaire"
    device:
      identifiers: ["routeur_solaire"]

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

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

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

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

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

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

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

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

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

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

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

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

  - name: "Mode Batterie"
    unique_id: "modebatterie"
    state_topic: "RouteurSolaire/in/ModeBatterie"
    command_topic: "RouteurSolaire/in/ModeBatterie"
    payload_on: "1"
    payload_off: "0"
    optimistic: false
    qos: 0
    retain: true
    device:
      identifiers: ["routeur_solaire"]

select:
  - name: "Offset EDF"
    unique_id: "OffsetEDF"
    icon: mdi:arrow-oscillating
    command_topic: "RouteurSolaire/in/OffsetEDF"
    options:
      - "-500"
      - "-400"
      - "-300"
      - "-200"
      - "-100"
      - "0"
      - "100"
      - "200"
      - "300"
      - "400"
      - "500"
    device:
      identifiers: ["routeur_solaire"]

  - name: "Offset Sol"
    unique_id: "OffsetSol"
    icon: mdi:arrow-oscillating
    command_topic: "RouteurSolaire/in/OffsetSol"
    options:
      - "0"
      - "100"
      - "200"
      - "300"
      - "400"
      - "500"
    device:
      identifiers: ["routeur_solaire"]

  - name: "Consigne Température"
    unique_id: "ConsigneTemp"
    icon: mdi:heat-wave
    command_topic: "RouteurSolaire/in/ConsigneT"
    options:
      - "40"
      - "42"
      - "44"
      - "46"
      - "48"
      - "50"
      - "52"
      - "54"
      - "56"
      - "58"
      - "60"
      - "62"
      - "64"
      - "66"
      - "68"
      - "70"
    device:
      identifiers: ["routeur_solaire"]
