Skip to content
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker Logo

Community Forum

  1. ioBroker Community Home
  2. Deutsch
  3. ioBroker Allgemein
  4. Pool Thermometer und Chlormesser

NEWS

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    8.3k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    13
    1
    2.0k

  • Neues Video "KI im Smart Home" - ioBroker plus n8n
    BluefoxB
    Bluefox
    15
    1
    2.4k

Pool Thermometer und Chlormesser

Geplant Angeheftet Gesperrt Verschoben ioBroker Allgemein
allgemein
118 Beiträge 30 Kommentatoren 21.0k Aufrufe 40 Watching
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • O oxident

    Okay, hier mal das YAML für ESPHome um die Blueconnects ohne Cloud auszulesen:

    substitutions:
      # erster Blueconnect
      blueriiot1_mac: '00:A0:50:ZZ:XX:YY'
      blueriiot1_name_prefix: 'pool'
      blueriiot1_id_prefix: 'pl'
    
      # zweiter Blueconnect
      # ggf. auskommentieren
      blueriiot2_mac: '00:A0:50:ZZ:XX:YY'
      blueriiot2_name_prefix: 'spa'
      blueriiot2_id_prefix: 'sp'
      
      # send true 0x01 to this service ID
      blueriiot_send_service_uuid: 'F3300001-F0A2-9B06-0C59-1BC4763B5C00'
      blueriiot_send_characteristic_uuid: 'F3300002-F0A2-9B06-0C59-1BC4763B5C00'
      
      # notification is recieved on this Service ID                  
      blueriiot_recieve_service_uuid: 'F3300001-F0A2-9B06-0C59-1BC4763B5C00'
      blueriiot_recieve_characteristic_uuid: 'F3300003-F0A2-9B06-0C59-1BC4763B5C00'
    
    esphome:
      name: "poolsensors"
      friendly_name: Poolsensoren
    
    esp32:
      board: m5stack-atom # ANPASSEN
      framework:
        type: arduino
    
    # Enable logging
    logger:
      #level: VERY_VERBOSE
      level: INFO
    
    # Enable Home Assistant API
    api:
      password: "1234"
     
    ota:
      password: "1234"
    
    wifi:
      ssid: !secret wifi_ssid
      password: !secret wifi_password
    
    
    esp32_ble_tracker:
    
    ble_client:
      # erster Sensor
      - mac_address: ${blueriiot1_mac}
        id: ble_client_${blueriiot1_id_prefix}
        on_connect: 
          then:
            - lambda: "id(binary_sensor_${blueriiot1_id_prefix}_connected).publish_state(true);"
            - delay: 2s
            - button.press: button_${blueriiot1_id_prefix}_doreading
        on_disconnect: [lambda: "id(binary_sensor_${blueriiot1_id_prefix}_connected).publish_state(false);"]
    
      # zweiter Sensor (optional)
      - mac_address: ${blueriiot2_mac}
        id: ble_client_${blueriiot2_id_prefix}
        on_connect: 
          then:
            - lambda: "id(binary_sensor_${blueriiot2_id_prefix}_connected).publish_state(true);"
            - delay: 2s
            - button.press: button_${blueriiot2_id_prefix}_doreading
        on_disconnect: [lambda: "id(binary_sensor_${blueriiot2_id_prefix}_connected).publish_state(false);"]
        
    
    binary_sensor:
    # erster Sensor  
      - platform: template
        id: binary_sensor_${blueriiot1_id_prefix}_connected
        name: ${blueriiot1_name_prefix} Status
        device_class: connectivity
        entity_category: diagnostic
    
    # zweiter Sensor (optional)
      - platform: template
        id: binary_sensor_${blueriiot2_id_prefix}_connected
        name: ${blueriiot2_name_prefix} Status
        device_class: connectivity
        entity_category: diagnostic
    
    
    switch:
      # erster Sensor
      - platform: ble_client
        ble_client_id: ble_client_${blueriiot1_id_prefix}
        name: "${blueriiot1_name_prefix} Enable"
        id: switch_${blueriiot1_id_prefix}_enable
        restore_mode: ALWAYS_OFF
      
      # zweiter Sensor (optional)
      - platform: ble_client
        ble_client_id: ble_client_${blueriiot2_id_prefix}
        name: "${blueriiot2_name_prefix} Enable"
        id: switch_${blueriiot2_id_prefix}_enable
        restore_mode: ALWAYS_OFF
    
    sensor:
      # erster Sensor
      - platform: template 
        id: sensor_${blueriiot1_id_prefix}_temperature
        name: ${blueriiot1_name_prefix} Temperature
        # Optional variables:
        unit_of_measurement: "°C"
        icon: "mdi:water-percent"
        device_class: "temperature"
        state_class: "measurement"
        accuracy_decimals: 1
      
      - platform: template 
        id: sensor_${blueriiot1_id_prefix}_ph
        name: ${blueriiot1_name_prefix} PH
        # Optional variables:
        #unit_of_measurement: "°C"
        #icon: "mdi:water-percent"
        #device_class: "temperature"
        state_class: "measurement"
        accuracy_decimals: 1
    
      - platform: template 
        id: sensor_${blueriiot1_id_prefix}_orp
        name: ${blueriiot1_name_prefix} Chlor
        # Optional variables:
        #unit_of_measurement: "°C"
        #icon: "mdi:water-percent"
        device_class: "voltage"
        state_class: "measurement"
        accuracy_decimals: 1
        
      - platform: template 
        id: sensor_${blueriiot1_id_prefix}_bat
        name: ${blueriiot1_name_prefix} Battery
        # Optional variables:
        #unit_of_measurement: "°C"
        #icon: "mdi:water-percent"
        device_class: "battery"
        state_class: "measurement"
        accuracy_decimals: 1
      # ENDE erster Sensor
    
      # zweiter Sensor (optional)
      - platform: template 
        id: sensor_${blueriiot2_id_prefix}_temperature
        name: ${blueriiot2_name_prefix} Temperature
        # Optional variables:
        unit_of_measurement: "°C"
        icon: "mdi:water-percent"
        device_class: "temperature"
        state_class: "measurement"
        accuracy_decimals: 1
      
      - platform: template 
        id: sensor_${blueriiot2_id_prefix}_ph
        name: ${blueriiot2_name_prefix} PH
        # Optional variables:
        #unit_of_measurement: "°C"
        #icon: "mdi:water-percent"
        #device_class: "temperature"
        state_class: "measurement"
        accuracy_decimals: 1
    
      - platform: template 
        id: sensor_${blueriiot2_id_prefix}_orp
        name: ${blueriiot2_name_prefix} Chlor
        # Optional variables:
        #unit_of_measurement: "°C"
        #icon: "mdi:water-percent"
        device_class: "voltage"
        state_class: "measurement"
        accuracy_decimals: 1
        
      - platform: template 
        id: sensor_${blueriiot2_id_prefix}_bat
        name: ${blueriiot2_name_prefix} Battery
        # Optional variables:
        #unit_of_measurement: "°C"
        #icon: "mdi:water-percent"
        device_class: "battery"
        state_class: "measurement"
        accuracy_decimals: 1
      # ENDE zweiter Sensor (optional)
        
    ##
    ## Blue Connect
    # erster Sensor
    button:
      - platform: template
        id: button_${blueriiot1_id_prefix}_doreading
        name: ${blueriiot1_name_prefix} do reading
        internal: true
        on_press:
          then:
            - ble_client.ble_write:
                id: ble_client_${blueriiot1_id_prefix}
                service_uuid: ${blueriiot_send_service_uuid}
                characteristic_uuid: ${blueriiot_send_characteristic_uuid}
                # A lambda returning an std::vector<uint8_t>.
                value: !lambda |-
                  return {0x01};
    
      # zweiter Sensor (optional)
      - platform: template
        id: button_${blueriiot2_id_prefix}_doreading
        name: ${blueriiot2_name_prefix} do reading
        internal: true
        on_press:
          then:
            - ble_client.ble_write:
                id: ble_client_${blueriiot2_id_prefix}
                service_uuid: ${blueriiot_send_service_uuid}
                characteristic_uuid: ${blueriiot_send_characteristic_uuid}
                # A lambda returning an std::vector<uint8_t>.
                value: !lambda |-
                  return {0x01};
    
    text_sensor:
      # erster Sensor
      - platform: ble_client
        id: ${blueriiot1_id_prefix}_reading_data
        name: ${blueriiot1_name_prefix} reading data
        internal: true
        ble_client_id: ble_client_${blueriiot1_id_prefix}
        service_uuid: ${blueriiot_recieve_service_uuid}
        characteristic_uuid: ${blueriiot_recieve_characteristic_uuid}
        notify: true
        update_interval: never
        on_notify:
          then:
           lambda: |-
              std::string rawhex = format_hex_pretty((uint8_t *) x.c_str(), x.size()).c_str();
              ESP_LOGD("raw_hex", "%s", rawhex.c_str());
    
              float temperature = (float)((int16_t)(x[2]<< 8) + x[1])/100;
              ESP_LOGD("temp", "%f", temperature);
              id(sensor_${blueriiot1_id_prefix}_temperature).publish_state(temperature);
                  
              float raw_ph = (float)( (int16_t) (x[4]<< 8) + x[3]) ;
              float ph = (float)( (int16_t) (2048 - raw_ph)) / 232  + 7 ; 
              ESP_LOGD("ph", "%f", ph);
              id(sensor_${blueriiot1_id_prefix}_ph).publish_state(ph);
              
              float orp = (float)( (int16_t) (x[6]<< 8) + x[5]) / 3.86 ;
              ESP_LOGD("orp", "%f", orp);
              id(sensor_${blueriiot1_id_prefix}_orp).publish_state(orp);
              
              float bat = (float)( (int16_t) x[11]) ;
              ESP_LOGD("bat", "%f", bat);
              id(sensor_${blueriiot1_id_prefix}_bat).publish_state(bat);
              
              
              
              id(switch_${blueriiot1_id_prefix}_enable).turn_off();
        # ENDE erster Sensor
    
        # zweiter Sensor (optional)
      - platform: ble_client
        id: ${blueriiot2_id_prefix}_reading_data
        name: ${blueriiot2_name_prefix} reading data
        internal: true
        ble_client_id: ble_client_${blueriiot2_id_prefix}
        service_uuid: ${blueriiot_recieve_service_uuid}
        characteristic_uuid: ${blueriiot_recieve_characteristic_uuid}
        notify: true
        update_interval: never
        on_notify:
          then:
           lambda: |-
              std::string rawhex = format_hex_pretty((uint8_t *) x.c_str(), x.size()).c_str();
              ESP_LOGD("raw_hex", "%s", rawhex.c_str());
    
              float temperature = (float)((int16_t)(x[2]<< 8) + x[1])/100;
              ESP_LOGD("temp", "%f", temperature);
              id(sensor_${blueriiot2_id_prefix}_temperature).publish_state(temperature);
                  
              float raw_ph = (float)( (int16_t) (x[4]<< 8) + x[3]) ;
              float ph = (float)( (int16_t) (2048 - raw_ph)) / 232  + 7 ; 
              ESP_LOGD("ph", "%f", ph);
              id(sensor_${blueriiot2_id_prefix}_ph).publish_state(ph);
              
              float orp = (float)( (int16_t) (x[6]<< 8) + x[5]) / 3.86 ;
              ESP_LOGD("orp", "%f", orp);
              id(sensor_${blueriiot2_id_prefix}_orp).publish_state(orp);
              
              float bat = (float)( (int16_t) x[11]) ;
              ESP_LOGD("bat", "%f", bat);
              id(sensor_${blueriiot2_id_prefix}_bat).publish_state(bat);
              
              
              
              id(switch_${blueriiot2_id_prefix}_enable).turn_off();
        # ENDE zweiter Sensor
    

    Bitte beachtet, dass Ihr ggf. die ganzen Teil zum zweiten Sensor auskommentieren müsst und natürlich auch das verwendete Board und die MAC-Adresse(n) anpassen müsst.

    Ich stelle das hier erstmal "zur Diskussion" rein. Vielleicht erspart es ja jemandem Arbeit ;-)

    D Offline
    D Offline
    Diamand2k22
    schrieb am zuletzt editiert von
    #86

    @oxident

    Hi, funktioniert das ESP32 Skript bei dir einwandfrei? Dann brauch ich kein Abo oder?

    O 1 Antwort Letzte Antwort
    0
    • D Diamand2k22

      @oxident

      Hi, funktioniert das ESP32 Skript bei dir einwandfrei? Dann brauch ich kein Abo oder?

      O Offline
      O Offline
      oxident
      schrieb am zuletzt editiert von
      #87

      @diamand2k22 Leider nein ... bin da bisher noch nicht weitergekommen. Theoretisch klappt es, praktisch ist es aber noch extrem unzuverlässig.

      Aber ja, wenn es klappt, dann braucht man weder Abo noch App.

      D 1 Antwort Letzte Antwort
      0
      • O oxident

        @diamand2k22 Leider nein ... bin da bisher noch nicht weitergekommen. Theoretisch klappt es, praktisch ist es aber noch extrem unzuverlässig.

        Aber ja, wenn es klappt, dann braucht man weder Abo noch App.

        D Offline
        D Offline
        Diamand2k22
        schrieb am zuletzt editiert von
        #88

        @oxident said in Pool Thermometer und Chlormesser:

        @diamand2k22 Leider nein ... bin da bisher noch nicht weitergekommen. Theoretisch klappt es, praktisch ist es aber noch extrem unzuverlässig.

        Aber ja, wenn es klappt, dann braucht man weder Abo noch App.

        Generell bin ich kein Freund von diesem Cloud Mist, bin da eher der Verfechter von lokaler Anbindung. Was klappt denn noch nicht so richtig im Detail mit dem Skript?

        1 Antwort Letzte Antwort
        0
        • O Offline
          O Offline
          oxident
          schrieb am zuletzt editiert von
          #89

          @diamand2k22 Es ist ein konzeptionelles Problem.

          Das Skript basiert auf ESPHome und erfordert daher einen ESP32. Die haben aber leider eine enorm schlechte BT-Reichweite und außerdem noch Stress bei gleichzeitiger BT/WiFi-Nutzung.

          Außerdem neigt ESPHome dazu, ständig mit den Clients verbunden zu bleiben. Da ich zwei Blueconnects verwende ist das super instabil.

          Daher suche ich nach einer anderen Plattform. Vielleicht auch irgendwas, was ganz stumpf vom iobroker direkt (BT-Stick) oder indirekt (BT-WiFi-Bridge) gesteuert werden kann.

          Es ist ja kein Hexenwerk den richtigen Befehl zu senden und dann die Rückgabe zu dekodieren. Bei Bluetooth-LE ist das aber alles zu hoch für mich.

          D 2 Antworten Letzte Antwort
          0
          • O oxident

            @diamand2k22 Es ist ein konzeptionelles Problem.

            Das Skript basiert auf ESPHome und erfordert daher einen ESP32. Die haben aber leider eine enorm schlechte BT-Reichweite und außerdem noch Stress bei gleichzeitiger BT/WiFi-Nutzung.

            Außerdem neigt ESPHome dazu, ständig mit den Clients verbunden zu bleiben. Da ich zwei Blueconnects verwende ist das super instabil.

            Daher suche ich nach einer anderen Plattform. Vielleicht auch irgendwas, was ganz stumpf vom iobroker direkt (BT-Stick) oder indirekt (BT-WiFi-Bridge) gesteuert werden kann.

            Es ist ja kein Hexenwerk den richtigen Befehl zu senden und dann die Rückgabe zu dekodieren. Bei Bluetooth-LE ist das aber alles zu hoch für mich.

            D Offline
            D Offline
            Diamand2k22
            schrieb am zuletzt editiert von Diamand2k22
            #90

            @oxident

            hab's jetzt erstmal soweit hinbekommen die Daten über die Cloud auszulesen.
            Ich denke damit kann man gut arbeiten!
            Danke für den tollen Adapter!

            1 Antwort Letzte Antwort
            0
            • O oxident

              @diamand2k22 Es ist ein konzeptionelles Problem.

              Das Skript basiert auf ESPHome und erfordert daher einen ESP32. Die haben aber leider eine enorm schlechte BT-Reichweite und außerdem noch Stress bei gleichzeitiger BT/WiFi-Nutzung.

              Außerdem neigt ESPHome dazu, ständig mit den Clients verbunden zu bleiben. Da ich zwei Blueconnects verwende ist das super instabil.

              Daher suche ich nach einer anderen Plattform. Vielleicht auch irgendwas, was ganz stumpf vom iobroker direkt (BT-Stick) oder indirekt (BT-WiFi-Bridge) gesteuert werden kann.

              Es ist ja kein Hexenwerk den richtigen Befehl zu senden und dann die Rückgabe zu dekodieren. Bei Bluetooth-LE ist das aber alles zu hoch für mich.

              D Offline
              D Offline
              Diamand2k22
              schrieb am zuletzt editiert von
              #91

              @oxident

              Hallo Oxident, hast du es mittlerweile hinbekommen die BlueConnect stabil auszulesen über esp32 oder ble Stick?
              Hättest du da paar neue Infos?
              Danke dir!

              O 1 Antwort Letzte Antwort
              0
              • FlexerF Offline
                FlexerF Offline
                Flexer
                schrieb am zuletzt editiert von
                #92

                Hi an alle. Vielleicht ist der Threat auch was für euch.

                https://forum.iobroker.net/topic/76039/automatsche-dosieranlage-low-budget/8

                Unterm Strich ist alles besser.


                Ja, voll geil hier!

                1 Antwort Letzte Antwort
                0
                • D Diamand2k22

                  @oxident

                  Hallo Oxident, hast du es mittlerweile hinbekommen die BlueConnect stabil auszulesen über esp32 oder ble Stick?
                  Hättest du da paar neue Infos?
                  Danke dir!

                  O Offline
                  O Offline
                  oxident
                  schrieb am zuletzt editiert von
                  #93

                  @diamand2k22 Jepp, eigentlich läuft es jetzt gut. Aber ich musste wirklich einen ESP32 mit ext. Antenne finden. Den esphome-Code kann ich gerne nachliefern!

                  1 Antwort Letzte Antwort
                  0
                  • D Offline
                    D Offline
                    Diamand2k22
                    schrieb am zuletzt editiert von
                    #94

                    @oxident

                    Was hast du denn genau an Hardware, dann würde ich mir das so auch zusammenbauen.
                    Ja und der Code wäre natürlich auch sehr interessant. Wenn du den zur Verfügung stellen könntest wäre natürlich super!

                    O 1 Antwort Letzte Antwort
                    0
                    • D Diamand2k22

                      @oxident

                      Was hast du denn genau an Hardware, dann würde ich mir das so auch zusammenbauen.
                      Ja und der Code wäre natürlich auch sehr interessant. Wenn du den zur Verfügung stellen könntest wäre natürlich super!

                      O Offline
                      O Offline
                      oxident
                      schrieb am zuletzt editiert von
                      #95

                      @diamand2k22 Letzten Endes habe ich diesen ESP32 hier benutzt: https://www.ebay.de/itm/373835160946?mkcid=16&mkevt=1&mkrid=707-127634-2357-0&ssspo=VPl0vy4uQMu&sssrc=4429486&ssuid=l3eyvw_dRxm&var=&widget_ver=artemis&media=COPY

                      Wichtig war die Antenne halt bei mir wegen WLAN und Bluetooth. Die regulären ESP32 konnten halt kaum eine Verbindung zum Blueconnect herstellen und hatten erst Recht Stress, wenn gleichzeitig Daten ins WLAN gesendet wurden.

                      Der neue ESP ist deutlich leistungsfähiger und bekommt zuverlässig die Daten vom Sensor.

                      Wie gesagt, YAML liefere ich nach, sobald ich zu Hause bin.

                      D W 2 Antworten Letzte Antwort
                      0
                      • O oxident

                        @diamand2k22 Letzten Endes habe ich diesen ESP32 hier benutzt: https://www.ebay.de/itm/373835160946?mkcid=16&mkevt=1&mkrid=707-127634-2357-0&ssspo=VPl0vy4uQMu&sssrc=4429486&ssuid=l3eyvw_dRxm&var=&widget_ver=artemis&media=COPY

                        Wichtig war die Antenne halt bei mir wegen WLAN und Bluetooth. Die regulären ESP32 konnten halt kaum eine Verbindung zum Blueconnect herstellen und hatten erst Recht Stress, wenn gleichzeitig Daten ins WLAN gesendet wurden.

                        Der neue ESP ist deutlich leistungsfähiger und bekommt zuverlässig die Daten vom Sensor.

                        Wie gesagt, YAML liefere ich nach, sobald ich zu Hause bin.

                        D Offline
                        D Offline
                        Diamand2k22
                        schrieb am zuletzt editiert von
                        #96

                        @oxident
                        Super danke dir, ich hab mir gleich den esp + Gehäuse bestellt!
                        Wegen dem Code mach dir keinen Stress, ich brauch eh erstmal die Hardware. 😀

                        D 1 Antwort Letzte Antwort
                        1
                        • D Diamand2k22

                          @oxident
                          Super danke dir, ich hab mir gleich den esp + Gehäuse bestellt!
                          Wegen dem Code mach dir keinen Stress, ich brauch eh erstmal die Hardware. 😀

                          D Offline
                          D Offline
                          Diamand2k22
                          schrieb am zuletzt editiert von
                          #97

                          @oxident

                          Hallo oxident, könntest du mir bitte die yaml zur Verfügung stellen?
                          Eine Frage noch, ist es dann möglich, die Messung unabhängig anzutriggern? Bei mir wird aktuell alle 75 Minuten über Sigfox gemessen natürlich mit Abo 😀

                          O 1 Antwort Letzte Antwort
                          0
                          • D Diamand2k22

                            @oxident

                            Hallo oxident, könntest du mir bitte die yaml zur Verfügung stellen?
                            Eine Frage noch, ist es dann möglich, die Messung unabhängig anzutriggern? Bei mir wird aktuell alle 75 Minuten über Sigfox gemessen natürlich mit Abo 😀

                            O Offline
                            O Offline
                            oxident
                            schrieb am zuletzt editiert von
                            #98

                            @diamand2k22 Hoppla, sorry. Völlig vergessen:

                            substitutions:
                              
                              # Blueconnect
                              blueriiot2_mac: '00:A0:50:24:79:67' # ANPASSEN
                              blueriiot2_name_prefix: 'spa'
                              blueriiot2_id_prefix: 'sp'
                            
                              # send true 0x01 to this service ID
                              blueriiot_send_service_uuid: 'F3300001-F0A2-9B06-0C59-1BC4763B5C00'
                              blueriiot_send_characteristic_uuid: 'F3300002-F0A2-9B06-0C59-1BC4763B5C00'
                              
                              # notification is recieved on this Service ID                  
                              blueriiot_recieve_service_uuid: 'F3300001-F0A2-9B06-0C59-1BC4763B5C00'
                              blueriiot_recieve_characteristic_uuid: 'F3300003-F0A2-9B06-0C59-1BC4763B5C00'
                            
                            esphome:
                              name: "poolsensors"
                              friendly_name: Pool
                              on_boot:
                                priority: 600
                                then:
                                  - delay: 20s
                            
                            esp32:
                              board: m5stack-atom # ANPASSEN
                              framework:
                                type: esp-idf
                                version: recommended
                            
                            # Enable logging
                            logger:
                              #level: VERY_VERBOSE
                              level: INFO
                            
                            # Enable Home Assistant API
                            api:
                              password: "1234"
                             
                            ota:
                              password: "1234"
                            
                            wifi:
                              ssid: !secret wifi_ssid
                              password: !secret wifi_password
                            
                            web_server:
                              port: 80
                            
                            output:
                              # Countermeasure to the problem that CH552 applies 4v to GPIO0, thus reducing WiFi sensitivity.
                              # Setting output_high adds a bias of 3.3v and suppresses overvoltage.
                              # From: https://github.com/m5stack/M5Unified/blob/d26d2415f409b664631ff066ceeaffd6a753a4ff/src/M5Unified.cpp#L506
                              - platform: gpio
                                id: wifi_fix_output
                                pin: GPIO0
                            
                            
                            esp32_ble_tracker:
                              scan_parameters:
                                active: false
                                interval: 1000ms
                                window: 700ms
                            
                              on_ble_advertise:
                                - mac_address: ${blueriiot2_mac}
                                  then:
                                    - logger.log: 
                                        format: "Found Spa sensor with RSSI %d"
                                        args: [ "x.get_rssi()"]
                                        level: "INFO"
                            
                            ble_client:
                              - mac_address: ${blueriiot2_mac}
                                id: ble_client_${blueriiot2_id_prefix}
                                on_connect: 
                                  then:
                                    - logger.log: 
                                        format: "Connected to 2nd sensor"
                                        level: "INFO"
                                    - lambda: "id(binary_sensor_${blueriiot2_id_prefix}_connected).publish_state(true);"
                                    - delay: 2s
                                    - button.press: button_${blueriiot2_id_prefix}_doreading
                                on_disconnect: [lambda: "id(binary_sensor_${blueriiot2_id_prefix}_connected).publish_state(false);"]
                                
                            binary_sensor:
                             - platform: template
                               id: binary_sensor_${blueriiot2_id_prefix}_connected
                               name: ${blueriiot2_name_prefix} Status
                               device_class: connectivity
                               entity_category: diagnostic
                            
                            # OPTIONAL und SPEZIFISCH für M5Atom
                            # derzeit: Led bei Knopfdruck an-/ausschalten
                            #  - platform: gpio # btn
                            #    id: pushbutton
                            #    pin:
                            #      number: 39
                            #      inverted: true
                            #    on_click:
                            #      then:
                            #        - if:
                            #            condition:
                            #              - light.is_on: matrix_light
                            #            then:
                            #              - light.turn_off: matrix_light
                            #            else:
                            #              - light.turn_on:
                            #                  id: matrix_light
                            #                  effect: rainbow
                            
                            #light:
                            #  - platform: fastled_clockless # 5x5 RGB Matrix (WS2812C)
                            #    name: "5x5 Matrix"
                            #    id: matrix_light
                            #    pin: 27
                            #    chipset: WS2812
                            #    num_leds: 25
                            #    color_correct: [50%, 50%, 50%] # The LED's on the Atom Matrix should not be run at full power
                            #    effects:
                            #      - addressable_rainbow:
                            #          name: rainbow
                            # ENDE spezifischer Teil M5Atom
                            
                            sensor:
                              - platform: ble_rssi
                                mac_address: ${blueriiot2_mac}
                                name: "RSSI value Spa sensor"
                            
                              - platform: template 
                                id: sensor_${blueriiot2_id_prefix}_temperature
                                name: ${blueriiot2_name_prefix} Temperature
                                # Optional variables:
                                unit_of_measurement: "°C"
                                icon: "mdi:water-percent"
                                device_class: "temperature"
                                state_class: "measurement"
                                accuracy_decimals: 1
                              
                              - platform: template 
                                id: sensor_${blueriiot2_id_prefix}_ph
                                name: ${blueriiot2_name_prefix} PH
                                # Optional variables:
                                #unit_of_measurement: "°C"
                                #icon: "mdi:water-percent"
                                #device_class: "temperature"
                                state_class: "measurement"
                                accuracy_decimals: 1
                            
                              - platform: template 
                                id: sensor_${blueriiot2_id_prefix}_orp
                                name: ${blueriiot2_name_prefix} Chloor
                                # Optional variables:
                                #unit_of_measurement: "°C"
                                #icon: "mdi:water-percent"
                                device_class: "voltage"
                                state_class: "measurement"
                                accuracy_decimals: 1
                                
                              - platform: template 
                                id: sensor_${blueriiot2_id_prefix}_bat
                                name: ${blueriiot2_name_prefix} Battery
                                # Optional variables:
                                unit_of_measurement: "%"
                                #icon: "mdi:water-percent"
                                device_class: "battery"
                                state_class: "measurement"
                                accuracy_decimals: 1
                                
                              - platform: template 
                                id: sensor_${blueriiot2_id_prefix}_salt
                                name: ${blueriiot2_name_prefix} Salt
                                # Optional variables:
                                unit_of_measurement: "g/L"
                                icon: "mdi:water-percent"
                                state_class: "measurement"
                                accuracy_decimals: 1
                                
                              - platform: template 
                                id: sensor_${blueriiot2_id_prefix}_cond
                                name: ${blueriiot2_name_prefix} Conductivity
                                # Optional variables:
                                unit_of_measurement: "mS/cm"
                                #icon: "mdi:water-percent"
                                state_class: "measurement"
                                accuracy_decimals: 1
                            
                            switch:
                              - platform: ble_client
                                ble_client_id: ble_client_${blueriiot2_id_prefix}
                                name: "${blueriiot2_name_prefix} Enable"
                                id: switch_${blueriiot2_id_prefix}_enable
                            
                              - platform: restart
                                name: "${blueriiot2_name_prefix} Restart"
                                id: switch_${blueriiot2_id_prefix}_restart
                            
                            button:
                              - platform: template
                                id: button_${blueriiot2_id_prefix}_doreading
                                name: ${blueriiot2_name_prefix} do reading
                                internal: true
                                on_press:
                                  then:
                                    - logger.log: 
                                        format: "Writing to 2nd sensor..."
                                        level: "INFO"
                                    - ble_client.ble_write:
                                        id: ble_client_${blueriiot2_id_prefix}
                                        service_uuid: ${blueriiot_send_service_uuid}
                                        characteristic_uuid: ${blueriiot_send_characteristic_uuid}
                                        # A lambda returning an std::vector<uint8_t>.
                                        value: !lambda |-
                                          return {0x01};
                            
                            text_sensor:
                              - platform: ble_client
                                id: ${blueriiot2_id_prefix}_reading_data
                                name: ${blueriiot2_name_prefix} reading data
                                internal: true
                                ble_client_id: ble_client_${blueriiot2_id_prefix}
                                service_uuid: ${blueriiot_recieve_service_uuid}
                                characteristic_uuid: ${blueriiot_recieve_characteristic_uuid}
                                notify: true
                                update_interval: never
                                on_notify:
                                  then:
                                   lambda: |-
                                      std::string rawhex = format_hex_pretty((uint8_t *) x.c_str(), x.size()).c_str();
                                      ESP_LOGD("raw_hex", "%s", rawhex.c_str());
                            
                                      float temperature = (float)((int16_t)(x[2]<< 8) + x[1])/100;
                                      ESP_LOGD("temp", "%f", temperature);
                                      id(sensor_${blueriiot2_id_prefix}_temperature).publish_state(temperature);
                            
                                      float raw_ph = (float)( (int16_t) (x[4]<< 8) + x[3]) ;
                                      float ph = (float)( (int16_t) (2048 - raw_ph)) / 232  + 7 ; 
                                      ESP_LOGD("ph", "%f", ph);
                                      id(sensor_${blueriiot2_id_prefix}_ph).publish_state(ph);
                            
                                      float orp = (float)( (int16_t) (x[6]<< 8) + x[5]) / 3.86  - 21.57826;
                                      ESP_LOGD("orp", "%f", orp);
                                      id(sensor_${blueriiot2_id_prefix}_orp).publish_state(orp);
                            
                                      float salt = (float)( (int16_t) (x[8]<< 8) + x[7]) / 25.0;
                                      ESP_LOGD("salt", "%f", salt);
                                      id(sensor_${blueriiot2_id_prefix}_salt).publish_state(salt);
                            
                                      float cond = (float)( (int16_t) (x[10]<< 8) + x[9]) / 0.4134;
                                      ESP_LOGD("cond", "%f", cond);
                                      id(sensor_${blueriiot2_id_prefix}_cond).publish_state(cond);
                            
                                      float bat = (float)( (int16_t) x[11]);
                                      ESP_LOGD("bat", "%f", bat);
                                      id(sensor_${blueriiot2_id_prefix}_bat).publish_state(bat);
                            
                                      id(switch_${blueriiot2_id_prefix}_enable).turn_off();
                            

                            Du müsstest eigentlich nur die MAC-Adresse ganz oben eintragen und den Rest nach belieben anpassen. Ich habe es auf einem m5stack-Atom laufen ... bei anderen solltest Du eventuell noch die "platform" ändern.

                            Ja, dann kannst Du so oft Du willst die Messung anstoßen. Einfach den "... enable" switch setzen und abwarten.

                            D 1 Antwort Letzte Antwort
                            0
                            • O oxident

                              @diamand2k22 Hoppla, sorry. Völlig vergessen:

                              substitutions:
                                
                                # Blueconnect
                                blueriiot2_mac: '00:A0:50:24:79:67' # ANPASSEN
                                blueriiot2_name_prefix: 'spa'
                                blueriiot2_id_prefix: 'sp'
                              
                                # send true 0x01 to this service ID
                                blueriiot_send_service_uuid: 'F3300001-F0A2-9B06-0C59-1BC4763B5C00'
                                blueriiot_send_characteristic_uuid: 'F3300002-F0A2-9B06-0C59-1BC4763B5C00'
                                
                                # notification is recieved on this Service ID                  
                                blueriiot_recieve_service_uuid: 'F3300001-F0A2-9B06-0C59-1BC4763B5C00'
                                blueriiot_recieve_characteristic_uuid: 'F3300003-F0A2-9B06-0C59-1BC4763B5C00'
                              
                              esphome:
                                name: "poolsensors"
                                friendly_name: Pool
                                on_boot:
                                  priority: 600
                                  then:
                                    - delay: 20s
                              
                              esp32:
                                board: m5stack-atom # ANPASSEN
                                framework:
                                  type: esp-idf
                                  version: recommended
                              
                              # Enable logging
                              logger:
                                #level: VERY_VERBOSE
                                level: INFO
                              
                              # Enable Home Assistant API
                              api:
                                password: "1234"
                               
                              ota:
                                password: "1234"
                              
                              wifi:
                                ssid: !secret wifi_ssid
                                password: !secret wifi_password
                              
                              web_server:
                                port: 80
                              
                              output:
                                # Countermeasure to the problem that CH552 applies 4v to GPIO0, thus reducing WiFi sensitivity.
                                # Setting output_high adds a bias of 3.3v and suppresses overvoltage.
                                # From: https://github.com/m5stack/M5Unified/blob/d26d2415f409b664631ff066ceeaffd6a753a4ff/src/M5Unified.cpp#L506
                                - platform: gpio
                                  id: wifi_fix_output
                                  pin: GPIO0
                              
                              
                              esp32_ble_tracker:
                                scan_parameters:
                                  active: false
                                  interval: 1000ms
                                  window: 700ms
                              
                                on_ble_advertise:
                                  - mac_address: ${blueriiot2_mac}
                                    then:
                                      - logger.log: 
                                          format: "Found Spa sensor with RSSI %d"
                                          args: [ "x.get_rssi()"]
                                          level: "INFO"
                              
                              ble_client:
                                - mac_address: ${blueriiot2_mac}
                                  id: ble_client_${blueriiot2_id_prefix}
                                  on_connect: 
                                    then:
                                      - logger.log: 
                                          format: "Connected to 2nd sensor"
                                          level: "INFO"
                                      - lambda: "id(binary_sensor_${blueriiot2_id_prefix}_connected).publish_state(true);"
                                      - delay: 2s
                                      - button.press: button_${blueriiot2_id_prefix}_doreading
                                  on_disconnect: [lambda: "id(binary_sensor_${blueriiot2_id_prefix}_connected).publish_state(false);"]
                                  
                              binary_sensor:
                               - platform: template
                                 id: binary_sensor_${blueriiot2_id_prefix}_connected
                                 name: ${blueriiot2_name_prefix} Status
                                 device_class: connectivity
                                 entity_category: diagnostic
                              
                              # OPTIONAL und SPEZIFISCH für M5Atom
                              # derzeit: Led bei Knopfdruck an-/ausschalten
                              #  - platform: gpio # btn
                              #    id: pushbutton
                              #    pin:
                              #      number: 39
                              #      inverted: true
                              #    on_click:
                              #      then:
                              #        - if:
                              #            condition:
                              #              - light.is_on: matrix_light
                              #            then:
                              #              - light.turn_off: matrix_light
                              #            else:
                              #              - light.turn_on:
                              #                  id: matrix_light
                              #                  effect: rainbow
                              
                              #light:
                              #  - platform: fastled_clockless # 5x5 RGB Matrix (WS2812C)
                              #    name: "5x5 Matrix"
                              #    id: matrix_light
                              #    pin: 27
                              #    chipset: WS2812
                              #    num_leds: 25
                              #    color_correct: [50%, 50%, 50%] # The LED's on the Atom Matrix should not be run at full power
                              #    effects:
                              #      - addressable_rainbow:
                              #          name: rainbow
                              # ENDE spezifischer Teil M5Atom
                              
                              sensor:
                                - platform: ble_rssi
                                  mac_address: ${blueriiot2_mac}
                                  name: "RSSI value Spa sensor"
                              
                                - platform: template 
                                  id: sensor_${blueriiot2_id_prefix}_temperature
                                  name: ${blueriiot2_name_prefix} Temperature
                                  # Optional variables:
                                  unit_of_measurement: "°C"
                                  icon: "mdi:water-percent"
                                  device_class: "temperature"
                                  state_class: "measurement"
                                  accuracy_decimals: 1
                                
                                - platform: template 
                                  id: sensor_${blueriiot2_id_prefix}_ph
                                  name: ${blueriiot2_name_prefix} PH
                                  # Optional variables:
                                  #unit_of_measurement: "°C"
                                  #icon: "mdi:water-percent"
                                  #device_class: "temperature"
                                  state_class: "measurement"
                                  accuracy_decimals: 1
                              
                                - platform: template 
                                  id: sensor_${blueriiot2_id_prefix}_orp
                                  name: ${blueriiot2_name_prefix} Chloor
                                  # Optional variables:
                                  #unit_of_measurement: "°C"
                                  #icon: "mdi:water-percent"
                                  device_class: "voltage"
                                  state_class: "measurement"
                                  accuracy_decimals: 1
                                  
                                - platform: template 
                                  id: sensor_${blueriiot2_id_prefix}_bat
                                  name: ${blueriiot2_name_prefix} Battery
                                  # Optional variables:
                                  unit_of_measurement: "%"
                                  #icon: "mdi:water-percent"
                                  device_class: "battery"
                                  state_class: "measurement"
                                  accuracy_decimals: 1
                                  
                                - platform: template 
                                  id: sensor_${blueriiot2_id_prefix}_salt
                                  name: ${blueriiot2_name_prefix} Salt
                                  # Optional variables:
                                  unit_of_measurement: "g/L"
                                  icon: "mdi:water-percent"
                                  state_class: "measurement"
                                  accuracy_decimals: 1
                                  
                                - platform: template 
                                  id: sensor_${blueriiot2_id_prefix}_cond
                                  name: ${blueriiot2_name_prefix} Conductivity
                                  # Optional variables:
                                  unit_of_measurement: "mS/cm"
                                  #icon: "mdi:water-percent"
                                  state_class: "measurement"
                                  accuracy_decimals: 1
                              
                              switch:
                                - platform: ble_client
                                  ble_client_id: ble_client_${blueriiot2_id_prefix}
                                  name: "${blueriiot2_name_prefix} Enable"
                                  id: switch_${blueriiot2_id_prefix}_enable
                              
                                - platform: restart
                                  name: "${blueriiot2_name_prefix} Restart"
                                  id: switch_${blueriiot2_id_prefix}_restart
                              
                              button:
                                - platform: template
                                  id: button_${blueriiot2_id_prefix}_doreading
                                  name: ${blueriiot2_name_prefix} do reading
                                  internal: true
                                  on_press:
                                    then:
                                      - logger.log: 
                                          format: "Writing to 2nd sensor..."
                                          level: "INFO"
                                      - ble_client.ble_write:
                                          id: ble_client_${blueriiot2_id_prefix}
                                          service_uuid: ${blueriiot_send_service_uuid}
                                          characteristic_uuid: ${blueriiot_send_characteristic_uuid}
                                          # A lambda returning an std::vector<uint8_t>.
                                          value: !lambda |-
                                            return {0x01};
                              
                              text_sensor:
                                - platform: ble_client
                                  id: ${blueriiot2_id_prefix}_reading_data
                                  name: ${blueriiot2_name_prefix} reading data
                                  internal: true
                                  ble_client_id: ble_client_${blueriiot2_id_prefix}
                                  service_uuid: ${blueriiot_recieve_service_uuid}
                                  characteristic_uuid: ${blueriiot_recieve_characteristic_uuid}
                                  notify: true
                                  update_interval: never
                                  on_notify:
                                    then:
                                     lambda: |-
                                        std::string rawhex = format_hex_pretty((uint8_t *) x.c_str(), x.size()).c_str();
                                        ESP_LOGD("raw_hex", "%s", rawhex.c_str());
                              
                                        float temperature = (float)((int16_t)(x[2]<< 8) + x[1])/100;
                                        ESP_LOGD("temp", "%f", temperature);
                                        id(sensor_${blueriiot2_id_prefix}_temperature).publish_state(temperature);
                              
                                        float raw_ph = (float)( (int16_t) (x[4]<< 8) + x[3]) ;
                                        float ph = (float)( (int16_t) (2048 - raw_ph)) / 232  + 7 ; 
                                        ESP_LOGD("ph", "%f", ph);
                                        id(sensor_${blueriiot2_id_prefix}_ph).publish_state(ph);
                              
                                        float orp = (float)( (int16_t) (x[6]<< 8) + x[5]) / 3.86  - 21.57826;
                                        ESP_LOGD("orp", "%f", orp);
                                        id(sensor_${blueriiot2_id_prefix}_orp).publish_state(orp);
                              
                                        float salt = (float)( (int16_t) (x[8]<< 8) + x[7]) / 25.0;
                                        ESP_LOGD("salt", "%f", salt);
                                        id(sensor_${blueriiot2_id_prefix}_salt).publish_state(salt);
                              
                                        float cond = (float)( (int16_t) (x[10]<< 8) + x[9]) / 0.4134;
                                        ESP_LOGD("cond", "%f", cond);
                                        id(sensor_${blueriiot2_id_prefix}_cond).publish_state(cond);
                              
                                        float bat = (float)( (int16_t) x[11]);
                                        ESP_LOGD("bat", "%f", bat);
                                        id(sensor_${blueriiot2_id_prefix}_bat).publish_state(bat);
                              
                                        id(switch_${blueriiot2_id_prefix}_enable).turn_off();
                              

                              Du müsstest eigentlich nur die MAC-Adresse ganz oben eintragen und den Rest nach belieben anpassen. Ich habe es auf einem m5stack-Atom laufen ... bei anderen solltest Du eventuell noch die "platform" ändern.

                              Ja, dann kannst Du so oft Du willst die Messung anstoßen. Einfach den "... enable" switch setzen und abwarten.

                              D Offline
                              D Offline
                              Diamand2k22
                              schrieb am zuletzt editiert von
                              #99

                              @oxident

                              Super danke dir 👍🏻 hattest du nicht ein ESP32 WROOM 32 DevKitC V4 38 Pin Board?

                              O 1 Antwort Letzte Antwort
                              0
                              • D Diamand2k22

                                @oxident

                                Super danke dir 👍🏻 hattest du nicht ein ESP32 WROOM 32 DevKitC V4 38 Pin Board?

                                O Offline
                                O Offline
                                oxident
                                schrieb am zuletzt editiert von
                                #100

                                @diamand2k22 Ja, in der Tat. Das nutze ich aber zusätzlich noch für ein paar andere Sachen (Poolabdeckung und ein paar Taster). Da war mir die YAML zu kompliziert zum Auseinanderpflücken ;-)

                                Habe daher die "alte" Version gepostet. Im Blueconnect-Teil hat sich aber nix verändert.

                                D 1 Antwort Letzte Antwort
                                0
                                • O oxident

                                  @diamand2k22 Ja, in der Tat. Das nutze ich aber zusätzlich noch für ein paar andere Sachen (Poolabdeckung und ein paar Taster). Da war mir die YAML zu kompliziert zum Auseinanderpflücken ;-)

                                  Habe daher die "alte" Version gepostet. Im Blueconnect-Teil hat sich aber nix verändert.

                                  D Offline
                                  D Offline
                                  Diamand2k22
                                  schrieb am zuletzt editiert von
                                  #101

                                  @oxident

                                  Danke dir, ich probiere es mal aus. Ist mein erster esp32 😀

                                  O 1 Antwort Letzte Antwort
                                  0
                                  • D Diamand2k22

                                    @oxident

                                    Danke dir, ich probiere es mal aus. Ist mein erster esp32 😀

                                    O Offline
                                    O Offline
                                    oxident
                                    schrieb am zuletzt editiert von
                                    #102

                                    @diamand2k22 Steile Lernkurve ... aber letzten Endes lohnt es sich und macht Spaß :-)

                                    D 1 Antwort Letzte Antwort
                                    1
                                    • M mameier1234

                                      @sithys-mahony Da liegst du richtig ...

                                      Username und Passwort, aus der App....

                                      vowillV Offline
                                      vowillV Offline
                                      vowill
                                      schrieb am zuletzt editiert von
                                      #103

                                      Danke an @mameier1234 für den Blueconnect-Adapter - funktioniert einwandfrei!
                                      Ein Hinweis für alle, die sich - wie ich zunächst - über den Zeitversatz bei der letzten Messung wundern: Der über den Adapter in xx.timestamp gelieferte Zeitstempel ist im GMT-Format. Für Deutschland müssen da also 1 (Winterzeit) bzw. 2 (Sommerzeit) Stunden hinzuaddiert werden. Oder man nutzt in einem Skript die Funktion:

                                      // Umwandlung Zeitstempel von GMT nach ME(S)Z
                                      timestamp_in_ME_S_Z = formatDate(getDateObject(getState('blueconnect.0.xxxx.ph.timestamp').val), 'TT.MM.JJJJ SS:mm:ss');

                                      bzw. als Blockly:
                                      Screenshot 2024-08-27 141425.jpg

                                      ioBroker im lxc auf NUC / Aktive Instanzen: 38

                                      1 Antwort Letzte Antwort
                                      1
                                      • O oxident

                                        @diamand2k22 Steile Lernkurve ... aber letzten Endes lohnt es sich und macht Spaß :-)

                                        D Offline
                                        D Offline
                                        Diamand2k22
                                        schrieb am zuletzt editiert von
                                        #104

                                        @oxident

                                        Wie hast du die Mac Adresse von dem BlueConnect herausgefunden?

                                        Gruß

                                        vowillV O 2 Antworten Letzte Antwort
                                        0
                                        • D Diamand2k22

                                          @oxident

                                          Wie hast du die Mac Adresse von dem BlueConnect herausgefunden?

                                          Gruß

                                          vowillV Offline
                                          vowillV Offline
                                          vowill
                                          schrieb am zuletzt editiert von
                                          #105

                                          @diamand2k22 Die Adresse wird vom Adapter automatisch eingetragen, wenn man sich mit Name und Passwort (aus der App) anmeldet. Voraussetzung ist, wie weiter oben geschrieben, dass man entweder einen Blueconnect Go Plus hat oder für den 'normalen' Blueconnect ein Abo bucht.

                                          ioBroker im lxc auf NUC / Aktive Instanzen: 38

                                          1 Antwort Letzte Antwort
                                          0
                                          Antworten
                                          • In einem neuen Thema antworten
                                          Anmelden zum Antworten
                                          • Älteste zuerst
                                          • Neuste zuerst
                                          • Meiste Stimmen


                                          Support us

                                          ioBroker
                                          Community Adapters
                                          Donate
                                          FAQ Cloud / IOT
                                          HowTo: Node.js-Update
                                          HowTo: Backup/Restore
                                          Downloads
                                          BLOG

                                          337

                                          Online

                                          32.4k

                                          Benutzer

                                          81.4k

                                          Themen

                                          1.3m

                                          Beiträge
                                          Community
                                          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                                          ioBroker Community 2014-2025
                                          logo
                                          • Anmelden

                                          • Du hast noch kein Konto? Registrieren

                                          • Anmelden oder registrieren, um zu suchen
                                          • Erster Beitrag
                                            Letzter Beitrag
                                          0
                                          • Home
                                          • Aktuell
                                          • Tags
                                          • Ungelesen 0
                                          • Kategorien
                                          • Unreplied
                                          • Beliebt
                                          • GitHub
                                          • Docu
                                          • Hilfe