• Hi, sorry, just saw your reply.
    I got it working OK. Maybe not the best way, but had to work around the things that I do understand and examples I found online =)

    captive_portal:
    
    esp32_ble_tracker:
      on_ble_service_data_advertise:
        - mac_address: E9:F5:D3:BB:1C:30
          service_uuid: 180F
          then:
            - lambda: 'id(PowerMeter_sensor_battery).publish_state(x[0]);'
    
        - mac_address: E9:F5:D3:BB:1C:30
          service_uuid: "1809"
          then:
            - lambda: 'id(PowerMeter_sensor_temperature).publish_state(x[0]);'
         
            
        - mac_address: E9:F5:D3:BB:1C:30
          service_uuid: 2A03
          then:
            - lambda: |-
                std::string b(x.begin(), x.end());
                std::string myStr = &b[0];
                float num_float = parse_float(myStr).value();
                ESP_LOGD("PowerMeter_sensor_instant_power:", "%s", &b[0] );
                id(PowerMeter_sensor_instant_power).publish_state(num_float);
                
        - mac_address: E9:F5:D3:BB:1C:30
          service_uuid: 2A04
          then:
            - lambda: |-
                std::string b(x.begin(), x.end());
                std::string myStr = &b[0];
                float num_float = parse_float(myStr).value();
                ESP_LOGD("PowerMeter_sensor_pulse_hour:", "%s", &b[0] );
                id(PowerMeter_sensor_pulse_hour).publish_state(num_float);      
    
        - mac_address: E9:F5:D3:BB:1C:30
          service_uuid: 2A05
          then:
            - lambda: |-
                std::string b(x.begin(), x.end());
                std::string myStr = &b[0];
                float num_float = parse_float(myStr).value();    
                ESP_LOGD("PowerMeter_sensor_pulse_day:", "%s", &b[0] );
                id(PowerMeter_sensor_pulse_day).publish_state(num_float);      
    
                
      on_ble_advertise:
          then:
            - lambda: |-
                ESP_LOGD("ble_adv", "New BLE device");
                ESP_LOGD("ble_adv", "  address: %s", x.address_str().c_str());
                ESP_LOGD("ble_adv", "  name: %s", x.get_name().c_str());
                ESP_LOGD("ble_adv", "  RSSI: %i", x.get_rssi());
                ESP_LOGD("ble_adv", "  Advertised service UUIDs:");
                for (auto uuid : x.get_service_uuids()) {
                    ESP_LOGD("ble_adv", "    - %s", uuid.to_string().c_str());
                }
                ESP_LOGD("ble_adv", "  Advertised service data:");
                for (auto data : x.get_service_datas()) {
                    ESP_LOGD("ble_adv", "    - %s: (length %i)", data.uuid.to_string().c_str(), data.data.size());
                    
                }
                ESP_LOGD("ble_adv", "  Advertised manufacturer data:");
                for (auto data : x.get_manufacturer_datas()) {
                    ESP_LOGD("ble_adv", "    - %s: (length %i)", data.uuid.to_string().c_str(), data.data.size());
                }
                if(x.get_ibeacon().has_value()) {
                  auto ibeacon = x.get_ibeacon().value();
                  ESP_LOGD("ble_adv", ibeacon.get_uuid().to_string().c_str());
                  ESP_LOGD("ble_adv", "Major: %i", ibeacon.get_major());
                  ESP_LOGD("ble_adv", "Minor: %i", ibeacon.get_minor());
                }
    
    sensor:
      - platform: template
        name: "PowerMeter_sensor_battery"
        id: PowerMeter_sensor_battery
        device_class: "battery"
        unit_of_measurement: "%"
      - platform: template
        name: "PowerMeter_sensor_temperature"
        id: PowerMeter_sensor_temperature
        device_class: "temperature"
        unit_of_measurement: "°C"
      - platform: template
        name: "PowerMeter_sensor_instant_power"
        id: PowerMeter_sensor_instant_power
        unit_of_measurement: "Wh"
        device_class: "energy"
      - platform: template
        name: "PowerMeter_sensor_pulse_hour"
        id: PowerMeter_sensor_pulse_hour
        unit_of_measurement: "Wh"
        device_class: "energy"
      - platform: template
        name: "PowerMeter_sensor_pulse_day"
        id: PowerMeter_sensor_pulse_day    
        unit_of_measurement: "Wh"
        device_class: "energy"
    
About

Avatar for user130485 @user130485 started