EspHome: LED colour and sensor for Sonoff Basic R2

I have flashed a Sonoff Basic R2 with EspHome. My button works as it should but there is something that I don’t understand.

  1. The button sensor has no value and so I cannot test if it is on or off
  2. It is possible to make the LED go blue, instead of read when on?

Here is my code:

esphome:
  name: smartplug-mainroom-ab

esp8266:
  board: sonoff_basic

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: !secret ota_password-sp-mrab

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

# Device Specific Config
binary_sensor:
  - platform: gpio
    id: push_button
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: True
    internal: true
    on_press:
      # Prevents unintended LED lit states.
      if:
        condition:
          - switch.is_off: relay
        then:
          - switch.turn_on: blue_led
          - switch.turn_on: relay
        else:
          - switch.turn_off: relay

switch:
  # The relay switches on the red side of the LED when active.
  - platform: gpio
    name: "SmartPlug Main Room - AB"
    pin: GPIO12
    id: relay
    on_turn_off:
      if:
        condition:
          - switch.is_on: blue_led
        then:
          - switch.turn_off: blue_led
  # With this we can control the blue side of the LED.
  - platform: gpio
    id: blue_led
    pin:
      number: GPIO13
      inverted: True

I copied the above code and cannot work out how the LED colour control works.

Because you have it as ‘internal’

Aah ok so I can still test the variable but just not see it in the dashboard?

Forgot about the send part. Is it possible to make the blue light come on instead of red?

According to this, the red is not controllable, and turning the blue on turns it purple (red+blue).