Electrolyseur E-Pool Technologie Justsalt

Merci c’est sympa, j’ai commandé. Pourrais-tu mettre le code en entier stp ? Merci

Oui je te colle ça dans la sem qd je serai chez moi le copier coller avce le smartphone c pas très pratique.

Pour info mon esp fait proxy pour les sondes plantes xiaomi ça marche très bien. Et ça permet aussi de piloter l’arrosage du jardin

esphome:
  name: esp-eth
  friendly_name: ESP-ETH
  #platform: ESP32
  ##oard: esp-wrover-kit

esp32:
  board: esp-wrover-kit
  framework:
    type: esp-idf
    #version: recommended
    #sdkconfig_options:
    #  COMPILER_OPTIMIZATION_SIZE: y

ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_IN
  phy_addr: 1
  power_pin: GPIO16
  manual_ip:
   static_ip: 192.168.8.8
   gateway: 192.168.8.1
   subnet: 255.255.255.0
   dns1: 192.168.8.1

# Enable logging
logger:
  level: WARN
  baud_rate: 0
  
# Enable Home Assistant API
api:
  encryption:
    key: *

ota:
  platform: esphome
  password:*

#wifi:
#  ssid: !secret wifi_ssid
#  password: !secret wifi_password
#  manual_ip:
#    static_ip: !secret wifi_espeth_ip
#    gateway: !secret wifi_gtw
#    subnet: !secret wifi_sub
#    dns1: !secret wifi_dns1

  # Enable fallback hotspot (captive portal) in case wifi connection fails
#  ap:
#    ssid: "Esp-Eth Fallback Hotspot"
#    password:*

#captive_portal:

web_server:
  port: 80  

#  JustSalt
substitutions:
  mac_justsalt: "*"
  service_uuid: '09912756-7b32-4629-aeb1-b309d9a338ae'
  characteristic_uuid: 'ef785c24-22bb-463d-b651-0b7445ba091c'
  characteristic_uuid_write: '4d32c5e5-2bb5-45c6-8c89-6f59bb3930d2'

bluetooth_proxy:
  active: true

esp32_ble_tracker:
  scan_parameters:
    #interval: 1100ms
    #window: 1100ms
    active: true

time:
  - platform: homeassistant
    id: homeassistant_time_5m
    on_time:
      - seconds: 0
        minutes: /5
        then:
          - switch.turn_off: ble_switch_com
          - delay: 20s
          - switch.turn_on: ble_switch_com

ble_client:
  - mac_address:  ${mac_justsalt}
    auto_connect: true
    id: JustSaltPro
    on_connect:
      then:
        - ble_client.numeric_comparison_reply:
            id: JustSaltPro
            accept: True


binary_sensor:
#  - platform: gpio
 ##   pin: GPIO14
 ##   name: "Compteur Deblit piscine"
  ##  internal: true
  ##  filters:
  #    - delayed_off: 10ms

  - platform: ble_presence
    mac_address: ${mac_justsalt}
    name: Electolyseur

  - platform: template  
    id: InjPHM
    name: "Injection PH-"
  
  - platform: template  
    id: InjPHP
    name: "Injection PH+"

number:
  - platform: template
    id: orp_consigne_new
    name: "ORP Consigne"
    icon: "mdi:flash-triangle-outline"
    unit_of_measurement: "mV"
    min_value: 200
    max_value: 900
    step: 10
    optimistic: true
    on_value: 
      then:
        - ble_client.ble_write:
            id: JustSaltPro
            service_uuid: ${service_uuid}
            characteristic_uuid: ${characteristic_uuid_write}
            value: !lambda |-
              //float state = std::stof(id(orp_consigne_new).state);
              ESP_LOGD("ORPconsigne", "Option consigne change:  %f", id(orp_consigne_new).state);   
              uint8_t statehex = id(orp_consigne_new).state / 10;
              return {0x00, 0x06, 0x03, 0x35, 0x01, statehex, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

  - platform: template
    id: orp_alarme_consigne
    name: "ORP Alarme Consigne"
    icon: "mdi:alarm"
    unit_of_measurement: "h"
    min_value: 12
    max_value: 96
    step: 6
    optimistic: true
    on_value: 
      then:
        - ble_client.ble_write:
            id: JustSaltPro
            service_uuid: ${service_uuid}
            characteristic_uuid: ${characteristic_uuid_write}
            value: !lambda |-
              //float state = std::stof(id(orp_consigne_new).state);
              ESP_LOGD("ORPalarmeconsigne", "Option consigne change:  %f", id(orp_alarme_consigne).state);   
              uint8_t statehex = id(orp_alarme_consigne).state;
              return {0x00, 0x06, 0x03, 0x37, 0x01, statehex, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
         
  - platform: template
    id: ph_consigne
    name: "PH Consigne"
    icon: "mdi:ph"
    unit_of_measurement: "ph"
    min_value: 6.8
    max_value: 7.6
    step: 0.1
    optimistic: true
    on_value: 
      then:
        - ble_client.ble_write:
            id: JustSaltPro
            service_uuid: ${service_uuid}
            characteristic_uuid: ${characteristic_uuid_write}
            value: !lambda |-
              ESP_LOGD("PHconsigne", "Option consigne change:  %f", id(ph_consigne).state);   
              uint8_t statehex = id(ph_consigne).state * 10;
              return {0x00, 0x06, 0x03, 0x30, 0x01, statehex, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
        
  - platform: template
    id: vol_consigne
    name: "Volume Consigne"
    icon: "mdi:cup-water"
    unit_of_measurement: "m3"
    min_value: 10
    max_value: 200
    step: 10
    optimistic: true
    on_value: 
      then:
        - ble_client.ble_write:
            id: JustSaltPro
            service_uuid: ${service_uuid}
            characteristic_uuid: ${characteristic_uuid_write}
            value: !lambda |-
              ESP_LOGD("volconsigne", "Option consigne change:  %f", id(vol_consigne).state);   
              uint8_t statehex = id(vol_consigne).state;
              return {0x00, 0x06, 0x03, 0x11, 0x02, 0x00, statehex, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

  - platform: template
    id: acide_consigne
    name: "acide Consigne"
    icon: "mdi:skull-crossbones-outline"
    unit_of_measurement: "%"
    min_value: 5
    max_value: 55
    step: 1
    optimistic: true
    on_value: 
      then:
        - ble_client.ble_write:
            id: JustSaltPro
            service_uuid: ${service_uuid}
            characteristic_uuid: ${characteristic_uuid_write}
            value: !lambda |-
              ESP_LOGD("acideconsigne", "Option consigne change:  %f", id(acide_consigne).state);   
              uint8_t statehex = id(acide_consigne).state;
              return {0x00, 0x06, 0x03, 0x32, 0x01, statehex, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

  - platform: template
    id: production_consigne
    name: "production Consigne"
    icon: "mdi:cog-outline"
    unit_of_measurement: "%"
    min_value: 10
    max_value: 100
    step: 1
    optimistic: true
    on_value: 
      then:
        - ble_client.ble_write:
            id: JustSaltPro
            service_uuid: ${service_uuid}
            characteristic_uuid: ${characteristic_uuid_write}
            value: !lambda |-
              ESP_LOGD("productionconsigne", "Option consigne change:  %f", id(production_consigne).state);   
              uint8_t statehex = id(production_consigne).state;
              return {0x00, 0x06, 0x03, 0x33, 0x01, statehex, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

  - platform: template
    id: inversion_consigne
    name: "inversion Consigne"
    icon: "mdi:alarm"
    unit_of_measurement: "h"
    min_value: 2
    max_value: 24
    step: 1
    optimistic: true
    on_value: 
      then:
        - ble_client.ble_write:
            id: JustSaltPro
            service_uuid: ${service_uuid}
            characteristic_uuid: ${characteristic_uuid_write}
            value: !lambda |-
              ESP_LOGD("inversionconsigne", "Option consigne change:  %f", id(inversion_consigne).state);   
              uint8_t statehex = id(inversion_consigne).state;
              return {0x00, 0x06, 0x03, 0x39, 0x01, statehex, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};


text_sensor:
  - platform: version
    name: ESPHome Version
  
#  - platform: wifi_info
#    ssid:
#      name: WiFi
  
  - id: ble_name2
    name: "Name"
    platform: template 

  - id: version_logiciel
    name: "version logiciel"
    platform: template 
  
  - id: slave
    name: "Slave"
    platform: template 
   
  - id: idcode
    name: "ID Code"
    platform: template  

  - platform: template
    name: "MAC bt"
    id: JustSalt_macbt_textsensor
  
  - platform: template
    name: "nom bt"
    id: JustSalt_nombt_textsensor
  
  - platform: template
    name: "SN"
    id: JustSalt_sn_textsensor

  - platform: template
    name: "temp90"
    id: JustSalt_90_textsensor
  
  - platform: template
    name: "temp91"
    id: JustSalt_91_textsensor

  - platform: template
    name: "temp9D"
    id: JustSalt_9d_textsensor
  
  - platform: template
    name: "tempD0"
    id: JustSalt_d0_textsensor

  - platform: template
    name: "tempE1"
    id: JustSalt_e1_textsensor

  - platform: template
    name: "tempE2"
    id: JustSalt_e2_textsensor
      
  - platform: template
    name: "tempE4"
    id: JustSalt_e4_textsensor
  
  - platform: template
    name: "tempA3"
    id: JustSalt_a3_textsensor

  - platform: template
    name: "Date etalonage PH"
    id: JustSalt_temp12_textsensor

  - platform: template
    name: "Date etalonage ORP"
    id: JustSalt_temp13_textsensor
    

sensor:
#  - platform: wifi_signal
#    name: Wifi signal
#    update_interval: 60s

  - platform: uptime
    name: Uptime

  # Débit d'eau instantané (0 après 10s)
  #- platform: pulse_meter        
  #  name: "Debit piscine"
  #  pin:
  #   number: GPIO14
  #   inverted: true
  #   mode:
  #      input: true
  #      pullup: true
  #  internal_filter: 10ms
  #  icon: mdi:water
  #  timeout: 60s
  #  unit_of_measurement: 'l/mn'
  #  filters:
  #    - multiply: 0.104895  # Conversion factor to L/min (1 pulse per second = 0.104895 L/min) Calculé à partir de 572 impulsions par litre,
  
  - platform: template
    name: "temp02"
    id: JustSalt_temp02_sensor
    accuracy_decimals: 0
    on_value:
      then:
        - lambda: |- 
            if (id(sensor_state).state == 1) {
              uint16_t temphex02 = id(JustSalt_temp02_sensor).raw_state;
              //ESP_LOGD(" --- temp 02 str", "%d", temphex02);
              id(InjPHM).publish_state((bool)((temphex02 & 0x000A) ));
              id(InjPHP).publish_state((bool)((temphex02 & 0x000C) ));
              }

  - platform: template
    name: "temp03"
    id: JustSalt_temp03_sensor
    accuracy_decimals: 0

  - platform: template
    name: "temp08"
    id: JustSalt_temp08_sensor
    accuracy_decimals: 0

  - platform: template
    name: "temp0B"
    id: JustSalt_temp0b_sensor
    accuracy_decimals: 0
  
  - platform: template
    name: "temp0C"
    id: JustSalt_temp0c_sensor
    accuracy_decimals: 0
  
  - platform: template
    name: "temp0D"
    id: JustSalt_temp0d_sensor
    accuracy_decimals: 0
  
  - platform: template
    name: "Compteur Heure total de fonctionnement"
    id: JustSalt_temp0e_sensor
    accuracy_decimals: 0
    unit_of_measurement: "h"
  
  - platform: template
    name: "minutes de fonctionement"
    id: JustSalt_temp0f_sensor
    unit_of_measurement: "min"
    accuracy_decimals: 0

  - platform: template
    name: "temp10"
    id: JustSalt_temp10_sensor
    accuracy_decimals: 0
 
  - platform: template
    name: "temp1f"
    id: JustSalt_temp1f_sensor
    accuracy_decimals: 0

  - platform: template
    name: "temp28"
    id: JustSalt_temp28_sensor
    accuracy_decimals: 0

  - platform: template
    name: "temp29"
    id: JustSalt_temp29_sensor
    accuracy_decimals: 0
  
  - platform: template
    name: "temp2A"
    id: JustSalt_temp2a_sensor
    accuracy_decimals: 0

  - platform: template
    name: "temp31"
    id: JustSalt_temp31_sensor
    accuracy_decimals: 0

  - platform: template
    name: "temp50"
    id: JustSalt_temp50_sensor
    accuracy_decimals: 0

  - platform: template
    name: "temp51"
    id: JustSalt_temp51_sensor
    accuracy_decimals: 0
  
  - platform: template
    name: "temp5F"
    id: JustSalt_temp5f_sensor
    accuracy_decimals: 0
  
  - platform: template
    name: "temp69"
    id: JustSalt_temp69_sensor
    accuracy_decimals: 0
  
  - platform: template
    name: "temp6A"
    id: JustSalt_temp6a_sensor
    accuracy_decimals: 0
  
  - platform: template
    name: "temp8F"
    id: JustSalt_temp8f_sensor
    accuracy_decimals: 0
  
  - platform: template
    name: "temp92"
    id: JustSalt_temp92_sensor
    accuracy_decimals: 0
      
  - platform: template
    name: "temp93"
    id: JustSalt_temp93_sensor
    accuracy_decimals: 0

  - platform: template
    name: "temp94"
    id: JustSalt_temp94_sensor
    accuracy_decimals: 0
      
  - platform: template
    name: "temp9B"
    id: JustSalt_temp9b_sensor
    accuracy_decimals: 0

  - platform: template
    name: "temp9C"
    id: JustSalt_temp9c_sensor
    accuracy_decimals: 0

  - platform: template
    name: "temp9D"
    id: JustSalt_temp9d_sensor
    accuracy_decimals: 0

  - platform: template
    name: "tempB0"
    id: JustSalt_tempb0_sensor
    accuracy_decimals: 0
  
  - platform: template
    name: "tempD1"
    id: JustSalt_tempd1_sensor
    accuracy_decimals: 0
  
  - platform: template
    name: "tempFE"
    id: JustSalt_tempfe_sensor
    accuracy_decimals: 0

  - platform: ble_rssi
    mac_address:  ${mac_justsalt}
    name: "JustSalt RSSI"  

  - platform: template
    name: "Temperature eau"
    id: JustSalt_temperature_sensor
    unit_of_measurement: "°C"
    accuracy_decimals: 1
    state_class: measurement
    device_class: temperature
  
  - platform: template
    name: "pH"
    id: JustSalt_ph_sensor
    unit_of_measurement: "pH"
    accuracy_decimals: 1
    state_class: measurement
    icon: mdi:ph
  
  - platform: template
    name: "ORP"
    id: JustSalt_orp_sensor
    unit_of_measurement: "mV"
    accuracy_decimals: 0
    state_class: measurement
    device_class: voltage
  
  - platform: template
    name: "TDS"
    id: JustSalt_tds_sensor
    unit_of_measurement: "g/L"
    accuracy_decimals: 1
    state_class: measurement
    icon: mdi:water-opacity

  - platform: ble_client
    ble_client_id: JustSaltPro
    name: "traitement"
    id: sensor_state    
    service_uuid: ${service_uuid} #'09912756-7b32-4629-aeb1-b309d9a338ae'
    characteristic_uuid: ${characteristic_uuid} #'ef785c24-22bb-463d-b651-0b7445ba091c'
    type: characteristic
    # update_interval: 2m
    notify: True
    lambda: |-     
      std::string value2(x.begin(), x.end());
      std::string rawhex = format_hex_pretty((uint8_t *) value2.c_str(), value2.size()).c_str();
      //ESP_LOGW("raw_hex_boucle", "-- Recep Debut --");
      //ESP_LOGD("raw_hex", "%s", rawhex.c_str());
      rawhex.erase(std::remove(rawhex.begin(), rawhex.end(), '.'), rawhex.end());
      
      int index = 3;

      while (index +2 < x.size()) {
        uint8_t idvaleur = x[index];
        int taillevaleur = x[index + 1 ];
      
        switch (idvaleur) {
          case 0x00: { 
            }break;
      
          case 0x01: {
            uint8_t phhex = x[index + 2];
            float ph = static_cast<float>(phhex)/10;
            id(JustSalt_ph_sensor).publish_state(ph);
            }break;

          case 0x02: {
            uint16_t temphex = ((x[index + 2]<< 8) + (x[index +3]));
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp02_sensor).publish_state(temp);
            }break;

          case 0x03: {
            uint8_t temphex = x[index + 2];
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp03_sensor).publish_state(temp);
            }break;

          case 0x06: {
            uint16_t orphex = ((x[index + 2]<< 8) + (x[index +3]));
            float orp = static_cast<float>(orphex);
            id(JustSalt_orp_sensor).publish_state(orp);
            }break;

          case 0x08: {
            uint8_t temphex = x[index + 2];
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp08_sensor).publish_state(temp);
            }break;

          case 0x09: {
            uint16_t tempeauhex = ((x[index + 2]<< 8) + (x[index +3]));
            float tempeau = static_cast<float>(tempeauhex)/10;
            id(JustSalt_temperature_sensor).publish_state(tempeau);
            }break;
          
          case 0x0A: {
            uint8_t selhex = x[index + 2] ;
            float sel = static_cast<float>(selhex)/10;
            id(JustSalt_tds_sensor).publish_state(sel);
            }break;

          case 0x0B: {
            uint8_t temphex = x[index + 2];
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp0b_sensor).publish_state(temp);
            }break;
          
          case 0x0C: {
            uint8_t temphex = x[index + 2];
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp0c_sensor).publish_state(temp);
            }break;

          case 0x0D: {
            uint16_t temphex = ((x[index + 2]<< 8) + (x[index +3]));
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp0d_sensor).publish_state(temp);
            }break;

          case 0x0E: {
            uint16_t temphex = ((x[index + 2]<< 8) + (x[index +3]));
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp0e_sensor).publish_state(temp);
            }break;

          case 0x0F: {
            uint8_t temphex = ((x[index + 2]<< 8) + (x[index +3]));
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp0f_sensor).publish_state(temp);
            }break;
          
          case 0x10: {
            uint16_t temphex = ((x[index + 2]<< 8) + (x[index +3]));
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp10_sensor).publish_state(temp);
            }break;

          case 0x11: {
            uint16_t volhex = ((x[index + 2]<< 8) + (x[index +3]));
            float vol = static_cast<float>(volhex);
            id(vol_consigne).publish_state(vol);
            }break;
          
          case 0x12: {
            uint8_t dayphex = (x[index + 3]);
            uint8_t monthphex = (x[index + 4]);
            uint8_t yearphex = (x[index +5]);
            int dayf = static_cast<int>(dayphex);
            int monthf = static_cast<int>(monthphex);
            int yearf = static_cast<int>(yearphex);
            std::string datestr =  std::to_string(dayf) + "/" + std::to_string(monthf) + "/20" + std::to_string(yearf);
            id(JustSalt_temp12_textsensor ).publish_state(datestr);
            }break;

          case 0x13: {
            uint8_t dayphex = (x[index + 3]);
            uint8_t monthphex = (x[index + 4]);
            uint8_t yearphex = (x[index +5]);
            int dayf = static_cast<int>(dayphex);
            int monthf = static_cast<int>(monthphex);
            int yearf = static_cast<int>(yearphex);
            std::string datestr =  std::to_string(dayf) + "/" + std::to_string(monthf) + "/20" + std::to_string(yearf);
            id(JustSalt_temp13_textsensor ).publish_state(datestr);
            }break;

          case 0x1F: {
            uint16_t temphex = ((x[index + 2]<< 8) + (x[index +3]));
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp1f_sensor).publish_state(temp);
            }break;
          
          case 0x28: {
            uint16_t temphex = ((x[index + 2]<< 8) + (x[index +3]));
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp28_sensor).publish_state(temp);
            }break;
          
          case 0x29: {
            uint8_t temphex = x[index + 2];
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp29_sensor).publish_state(temp);
            }break;
        
          case 0x2A: {
            uint8_t temphex = x[index + 2];
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp2a_sensor).publish_state(temp);
            }break;
          
          case 0x30: {
            uint8_t phchex = x[index + 2] ;
            float phc = static_cast<float>(phchex)/10;
            auto phcstr = value_accuracy_to_string (phc,1);
            id(ph_consigne).publish_state(phc);
            }break;
          
          case 0x31: {
            uint8_t temphex = x[index + 2];
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp31_sensor).publish_state(temp);
            }break;         

          case 0x32: {
            uint8_t acidehex = x[index + 2] ;
            float acide = static_cast<float>(acidehex);
            id(acide_consigne).publish_state(acide);
            }break;
          
          case 0x33: {
            uint8_t prodhex = x[index + 2] ;
            float prod = static_cast<float>(prodhex);
            id(production_consigne).publish_state(prod);
            }break;

          case 0x35: {
            uint8_t orpchex = x[index + 2] ;
            float orpc = static_cast<float>(orpchex)*10;
            id(orp_consigne_new).publish_state(orpc);
            }break;
          
          case 0x37: {
            uint8_t alarmeorphex = x[index + 2] ;
            float alarmeorp = static_cast<float>(alarmeorphex);
            id(orp_alarme_consigne).publish_state(alarmeorp);
            }break;
 
          case 0x39: {
            uint8_t inversionhex = x[index + 2] ;
            float inversionval = static_cast<float>(inversionhex);
            id(inversion_consigne).publish_state(inversionval);
            }break;

          case 0x50: {
            uint8_t temphex = x[index + 2];
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp50_sensor).publish_state(temp);
            }break;

          case 0x51: {
            uint8_t temphex = x[index + 2];
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp51_sensor).publish_state(temp);
            }break;

          case 0x5F: {
            uint8_t temphex = x[index + 2];
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp5f_sensor).publish_state(temp);
            }break;
          
          case 0x69: {
            uint32_t temphex = (x[index + 2]<< 24) + (x[index + 3]<< 16)+ (x[index + 4]<< 8) + (x[index +5]);
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp69_sensor).publish_state(temp);
            }break;

          case 0x6A: {
            uint8_t temphex = x[index + 2];
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp6a_sensor).publish_state(temp);
            }break;

          case 0x8F: {
            uint8_t temphex = x[index + 2];
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp8f_sensor).publish_state(temp);
            }break;
            
          case 0x90: {
            // 90.08.00.00.00.00.00.00.00.14.
            std::string tempstring = value2.substr((index + 2 ), taillevaleur);
            id(JustSalt_90_textsensor).publish_state(tempstring.c_str());
            }break;

          case 0x91: {
            //  91.08.00.00.00.00.00.06.6F.C3.
            std::string tempstring = value2.substr((index + 2 ), taillevaleur);
            id(JustSalt_91_textsensor).publish_state(tempstring.c_str());
            }break;
          
          case 0x92: {
            uint8_t temphex = x[index + 2];
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp92_sensor).publish_state(temp);
            }break;

          case 0x93: {
            uint16_t temphex = ((x[index + 2]<< 8) + (x[index +3]));
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp93_sensor).publish_state(temp);
            }break;

          case 0x94: {
            uint16_t temphex = ((x[index + 2]<< 8) + (x[index +3]));
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp94_sensor).publish_state(temp);
            }break;

          case 0x95: {
            uint32_t idcodehex = (x[index + 2]<< 24) + (x[index + 3]<< 16)+ (x[index + 4]<< 8) + (x[index +5]);
            float idcodefloat = static_cast<float>(idcodehex);
            std::string idcodestr = value_accuracy_to_string (idcodefloat,0);
            id(idcode).publish_state(idcodestr);
            }break;
          
          case 0x96: {
            std::string verlog = rawhex.substr((index + 2 )* 2, 2) + "." + rawhex.substr((index + 2 )* 2 + 2, 2);
            id(version_logiciel).publish_state(verlog);
            }break;
          
          case 0x97: {
            std::string slaveval = rawhex.substr((index + 2 )* 2, 2) + "." + rawhex.substr((index + 2 )* 2 + 2, 2);
            id(slave).publish_state(slaveval);
            }break;

          case 0x99: {
            //99.16.47.45.4E.5F.30.35.32.32.2D.30.34.33.39.35.33.2D.30.30.33.00.00.00.
            std::string tempstring = value2.substr((index + 2 ), taillevaleur);
            id(JustSalt_nombt_textsensor).publish_state(tempstring.c_str());
            }break;

          case 0x9A: {
            //9A.10.30.35.32.32.2D.30.34.33.39.35.33.2D.30.30.33.00.
            std::string tempstring = value2.substr((index + 2 ), taillevaleur);
            id(JustSalt_sn_textsensor).publish_state(tempstring.c_str());
            }break;

          case 0x9B: {
            uint16_t temphex = ((x[index + 2]<< 8) + (x[index +3]));
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp9b_sensor).publish_state(temp);
            }break;

          case 0x9C: {
            uint16_t temphex = ((x[index + 2]<< 8) + (x[index +3]));
            float temp = static_cast<float>(temphex);
            id(JustSalt_temp9c_sensor).publish_state(temp);
            }break;

          case 0x9D: {
            //  9D.08.00.00.00.00.00.00.01.FF
            std::string tempstring = rawhex.substr((index + 2 )* 2, 8);
            id(JustSalt_9d_textsensor).publish_state(tempstring);
            }break;
          
          case 0xA3: {
            //  E1.0F.18.04.11.11.00.33.00.00.88.00.F8.00.00.00.00
            std::string tempstring = rawhex.substr((index + 2 )* 2, 15);
            id(JustSalt_a3_textsensor).publish_state(tempstring);
            }break;
          
          case 0xB0: {
            uint8_t temphex = x[index + 2];
            float temp = static_cast<float>(temphex);
            id(JustSalt_tempb0_sensor).publish_state(temp);
            }break;
  
          case 0xB1: {
            std::string tempstring = rawhex.substr((index + 2 )* 2, 12);
            id(JustSalt_macbt_textsensor).publish_state(tempstring);
            }break;
          
          case 0xD0: {
            //D0.06.30.00.00.00.00.00
            std::string tempstring = rawhex.substr((index + 2 )* 2, 6);
            id(JustSalt_d0_textsensor).publish_state(tempstring);
            }break;

          case 0xD1: {
            uint8_t temphex = x[index + 2];
            float temp = static_cast<float>(temphex);
            id(JustSalt_tempd1_sensor).publish_state(temp);
            }break;
   
          case 0xFE: {
            uint8_t temphex = x[index + 2];
            float temp = static_cast<float>(temphex);
            id(JustSalt_tempfe_sensor).publish_state(temp);
            }break;
  
          case 0xE1: {
            //  E1.0F.18.04.11.11.00.33.00.00.88.00.F8.00.00.00.00
            std::string tempstring = rawhex.substr((index + 2 )* 2, 30);
            id(JustSalt_e1_textsensor).publish_state(tempstring);
            }break;
            
          case 0xE2: {
            // E2.0F.18.04.16.0A.22.10.00.00.00.41.3E.DC.00.00.00
            std::string tempstring = rawhex.substr((index + 2 )* 2, 30);
            id(JustSalt_e2_textsensor).publish_state(tempstring);
            }break;

          case 0xE4: {
            // E4.0F.18.04.12.15.00.00.46.00.0B.13.00.00.00.00.00
            std::string tempstring = rawhex.substr((index + 2 )* 2, 30);
            id(JustSalt_e4_textsensor).publish_state(tempstring);
            }break;

          default: {
              ESP_LOGW("raw_hex_boucle", "idvaleur Non implementee %d", idvaleur);
            };
          }
        index = index + 2 + taillevaleur ;
      }
      //ESP_LOGW("raw_hex_boucle", "-- Recep FIN --");
      return 1;


switch:      
  - platform: restart
    name: JustSalt_Gatway restart    

  - platform: ble_client
    id: ble_switch_com
    ble_client_id: JustSaltPro
    name: "Enable com JustSalt"

Merci je teste ça quand j’aurai reçu la « chose »