name: Weather station
products:
  - id: nghjvn2pcjllwska
    model: WeatherStation Pro™
entities:
  - entity: sensor
    name: Local temperature
    class: temperature
    dps:
      - id: 131
        type: integer
        name: sensor
        unit: C
        mapping:
          - scale: 10
  - entity: sensor
    name: Weather icon
    class: enum
    icon: "mdi:weather-partly-snowy-rainy"
    dps:
      - id: 103
        optional: true
        type: base64
        name: sensor
        mask: 000000FF00000000000000000000000000
        mapping:
          - dps_val: null
            value: None
          - dps_val: 0
            value: None
          - dps_val: 1
            value: Sunny
          - dps_val: 2
            value: Cloudy
          - dps_val: 3
            value: Sunny and cloudy
          - dps_val: 4
            value: Cloudy and light rain
          - dps_val: 5
            value: Cloudy and moderate rain
          - dps_val: 6
            value: Cloudy and heavy rain
          - dps_val: 7
            value: Cloudy, rain and thunder
          - dps_val: 8
            value: Snowy
          - dps_val: 9
            value: Cloudy and snowy
          - dps_val: 10
            value: Cloudy, rainy and snowy
      - id: 103
        optional: true
        type: base64
        name: payload
  - entity: sensor
    name: Local humidity
    class: humidity
    dps:
      - id: 132
        type: integer
        name: sensor
        unit: "%"
        class: measurement
  - entity: sensor
    name: Sensor 1 temperature
    class: temperature
    dps:
      - id: 133
        optional: true
        type: integer
        name: sensor
        unit: C
        mapping:
          - scale: 10
  - entity: sensor
    name: Sensor 1 humidity
    class: humidity
    dps:
      - id: 134
        optional: true
        type: integer
        name: sensor
        unit: "%"
        class: measurement
  - entity: sensor
    name: Sensor 2 temperature
    class: temperature
    dps:
      - id: 135
        optional: true
        type: integer
        name: sensor
        unit: C
        mapping:
          - scale: 10
  - entity: sensor
    name: Sensor 2 humidity
    class: humidity
    dps:
      - id: 136
        optional: true
        type: integer
        name: sensor
        unit: "%"
        class: measurement
  - entity: sensor
    name: Sensor 3 temperature
    class: temperature
    dps:
      - id: 137
        optional: true
        type: integer
        name: sensor
        unit: C
        mapping:
          - scale: 10
  - entity: sensor
    name: Sensor 3 humidity
    class: humidity
    dps:
      - id: 138
        optional: true
        type: integer
        name: sensor
        unit: "%"
        class: measurement
  - entity: select
    name: Time mode
    icon: "mdi:clock-edit"
    category: config
    dps:
      - id: 102
        type: boolean
        name: option
        mapping:
          - dps_val: true
            value: 24h
          - dps_val: false
            value: 12h
  - entity: switch
    name: Alarm
    icon: "mdi:alarm-light"
    category: config
    dps:
      - id: 104
        type: boolean
        name: switch
      - id: 110
        type: string
        name: alarm_state
        mapping:
          - dps_val: 0
            value: Alarm
          - dps_val: 1
            value: Silent
          - dps_val: 2
            value: Enabled
          - dps_val: 3
            value: Disabled
      - id: 109
        optional: true
        type: base64
        name: settings_payload
      - id: 117
        optional: true
        type: bitfield
        name: notifications_payload
  - entity: select
    translation_key: temperature_unit
    category: config
    dps:
      - id: 105
        type: string
        name: option
        mapping:
          - dps_val: c
            value: celsius
          - dps_val: f
            value: fahrenheit
  - entity: light
    translation_key: display
    category: config
    dps:
      - id: 106
        type: integer
        name: brightness
        mapping:
          - dps_val: 0
            value: 0
          - dps_val: 1
            value: 85
          - dps_val: 2
            value: 170
          - dps_val: 3
            value: 255
  - entity: switch
    name: Network time
    icon: "mdi:timer-cog-outline"
    category: config
    dps:
      - id: 111
        type: boolean
        name: switch
      - id: 101
        optional: true
        type: base64
        name: payload
      - id: 101
        optional: true
        type: base64
        name: year
        mask: "FF000000000000"
      - id: 101
        optional: true
        type: base64
        name: month
        mask: 00FF0000000000
        mapping:
          - dps_val: 1
            value: January
          - dps_val: 2
            value: February
          - dps_val: 3
            value: March
          - dps_val: 4
            value: April
          - dps_val: 5
            value: May
          - dps_val: 6
            value: June
          - dps_val: 7
            value: July
          - dps_val: 8
            value: August
          - dps_val: 9
            value: September
          - dps_val: 10
            value: October
          - dps_val: 11
            value: November
          - dps_val: 12
            value: December
      - id: 101
        optional: true
        type: base64
        name: day
        mask: "0000FF00000000"
      - id: 101
        optional: true
        type: base64
        name: hour
        mask: "000000FF000000"
      - id: 101
        optional: true
        type: base64
        name: minute
        mask: "00000000FF0000"
      - id: 101
        optional: true
        type: base64
        name: second
        mask: "0000000000FF00"
      - id: 101
        optional: true
        type: base64
        name: weekday
        mask: "000000000000FF"
        mapping:
          - dps_val: 1
            value: Monday
          - dps_val: 2
            value: Tuesday
          - dps_val: 3
            value: Wednesday
          - dps_val: 4
            value: Thursday
          - dps_val: 5
            value: Friday
          - dps_val: 6
            value: Saturday
          - dps_val: 7
            value: Sunday
  - entity: switch
    name: LCD night mode
    icon: "mdi:weather-night"
    category: config
    dps:
      - id: 129
        type: boolean
        name: switch
      - id: 130
        optional: true
        type: base64
        name: payload
      - id: 130
        optional: true
        type: base64
        name: start_hour
        mask: "FF000000"
      - id: 130
        optional: true
        type: base64
        name: start_minute
        mask: "00FF0000"
      - id: 130
        optional: true
        type: base64
        name: end_hour
        mask: "0000FF00"
      - id: 130
        optional: true
        type: base64
        name: end_minute
        mask: "000000FF"
  # diagnostic section, base64 dps
  - entity: binary_sensor
    category: diagnostic
    name: Display settings
    class: problem
    dps:
      - id: 108
        optional: true
        type: base64
        name: sensor
        mapping:
          - dps_val: null
            value: true
          - value: false
      - id: 108
        optional: true
        type: base64
        name: payload
      - id: 108
        optional: true
        type: base64
        name: uv_index
        mask: FF00000000000000000000
        mapping:
          - dps_val: 1
            value: true
          - dps_val: 0
            value: false
      - id: 108
        optional: true
        type: base64
        name: sunrise_sunset
        mask: 00FF000000000000000000
        mapping:
          - dps_val: 1
            value: true
          - dps_val: 0
            value: false
      - id: 108
        optional: true
        type: base64
        name: three_day_forecast_temperature
        mask: 0000FF0000000000000000
        mapping:
          - dps_val: 1
            value: true
          - dps_val: 0
            value: false
      - id: 108
        optional: true
        type: base64
        name: hourly_forecast
        mask: 000000FF00000000000000
        mapping:
          - dps_val: 1
            value: true
          - dps_val: 0
            value: false
      - id: 108
        optional: true
        type: base64
        name: three_day_forecast_weather
        mask: 00000000FF000000000000
        mapping:
          - dps_val: 1
            value: true
          - dps_val: 0
            value: false
      - id: 108
        optional: true
        type: base64
        name: local_temperature_humidity
        mask: 0000000000FF0000000000
        mapping:
          - dps_val: 1
            value: true
          - dps_val: 0
            value: false
      - id: 108
        optional: true
        type: base64
        name: date
        mask: 000000000000FF00000000
        mapping:
          - dps_val: 1
            value: true
          - dps_val: 0
            value: false
      - id: 108
        optional: true
        type: base64
        name: week
        mask: 00000000000000FF000000
        mapping:
          - dps_val: 1
            value: true
          - dps_val: 0
            value: false
      - id: 108
        optional: true
        type: base64
        name: hourly_forecast_weather
        mask: 0000000000000000FF0000
        mapping:
          - dps_val: 1
            value: true
          - dps_val: 0
            value: false
      - id: 108
        optional: true
        type: base64
        name: sensor_1_temperature_humidity
        mask: 000000000000000000FF00
        mapping:
          - dps_val: 1
            value: true
          - dps_val: 0
            value: false
      - id: 108
        optional: true
        type: base64
        name: sensor_2_temperature_humidity
        mask: 00000000000000000000FF
        mapping:
          - dps_val: 1
            value: true
          - dps_val: 0
            value: false
  - entity: sensor
    category: diagnostic
    name: Device status
    class: enum
    dps:
      - id: 107
        optional: true
        type: base64
        name: sensor
        mask: FF000000000000
        mapping:
          - dps_val: 0
            value: Offline
          - dps_val: 1
            value: Online
  - entity: sensor
    category: diagnostic
    name: Sensor 1 status
    class: enum
    dps:
      - id: 107
        optional: true
        type: base64
        name: sensor
        mask: 00FF0000000000
        mapping:
          - dps_val: 0
            value: Offline
          - dps_val: 1
            value: Online
          - dps_val: 2
            value: Unpaired
          - dps_val: 3
            value: None
  - entity: sensor
    category: diagnostic
    name: Sensor 2 status
    class: enum
    dps:
      - id: 107
        optional: true
        type: base64
        name: sensor
        mask: 0000FF00000000
        mapping:
          - dps_val: 0
            value: Offline
          - dps_val: 1
            value: Online
          - dps_val: 2
            value: Unpaired
          - dps_val: 3
            value: None
  - entity: sensor
    category: diagnostic
    name: Sensor 3 status
    class: enum
    dps:
      - id: 107
        optional: true
        type: base64
        name: sensor
        mask: 000000FF000000
        mapping:
          - dps_val: 0
            value: Offline
          - dps_val: 1
            value: Online
          - dps_val: 2
            value: Unpaired
          - dps_val: 3
            value: None
  - entity: sensor
    category: diagnostic
    name: Sensor 1 batery status
    class: enum
    dps:
      - id: 107
        optional: true
        type: base64
        name: sensor
        mask: 00000000FF0000
        mapping:
          - dps_val: 0
            value: Low
          - dps_val: 1
            value: Normal
          - dps_val: 2
            value: None
  - entity: sensor
    category: diagnostic
    name: Sensor 2 batery status
    class: enum
    dps:
      - id: 107
        optional: true
        type: base64
        name: sensor
        mask: 0000000000FF00
        mapping:
          - dps_val: 0
            value: Low
          - dps_val: 1
            value: Normal
          - dps_val: 2
            value: None
  - entity: sensor
    category: diagnostic
    name: Sensor 3 batery status
    class: enum
    dps:
      - id: 107
        optional: true
        type: base64
        name: sensor
        mask: 000000000000FF
        mapping:
          - dps_val: 0
            value: Low
          - dps_val: 1
            value: Normal
          - dps_val: 2
            value: None
  - entity: binary_sensor
    category: diagnostic
    class: problem
    dps:
      - id: 113
        optional: true
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - dps_val: 1
            value: true
          - dps_val: 2
            value: true
          - dps_val: 3
            value: true
      - id: 113
        optional: true
        type: bitfield
        name: fault_code
