Elgin/Tuya Lightbulb - Color Temperature In Kelvin not updating on slide widget

Hi, I’m pretty new at home automation systems.

I recently install openhab on a raspberry 4 and is working amazingly until now.
I have all my gear (switches, bulbs, and sonoff) connected to openhab through Alexa, basic commands work fine, but when I take a little close to bulbs commands I have to chase tails all around about it.

I’ve set all channels into items and that is what I could retrieve until now:

  • Brightness
  • Color
  • Color Name
  • Color Temperature In Kelvin
  • Color Temperature Name
  • Power State

When I enter on Color Temperature In Kelvin mode I get some information about it, starting with a number that changes when I alter the light temperature on my mobile going to 1000 (warm) and 10000 (cold).

I’m been editing some widgets that I found around and get this:

uid: Cell_Light_Card_1
tags: []
props:
  parameters:
    - description: Small title on top of the card
      label: Title
      name: title
      required: false
      type: TEXT
    - description: Header big sized
      label: Header
      name: header
      required: false
      type: TEXT
    - description: Icon on top of the card (only f7 icons (without f7:))
      label: Icon
      name: icon
      required: false
      type: TEXT
    - description: rgba or HEX
      label: Background Color
      name: bgcolor
      required: false
      type: TEXT
    - context: item
      description: Item to control on/off
      label: Item
      name: item_schalter
      required: false
      type: TEXT
    - context: item
      description: Item to control brightness
      label: Item
      name: item_brightness
      required: false
      type: TEXT
    - context: item
      description: Item to control Warmth
      label: Item
      name: item_warmth
      required: false
      type: TEXT
  parameterGroups: []
timestamp: Feb 27, 2022, 6:55:08 PM
component: f7-card
config:
  style:
    noShadow: false
    padding: 0px
    border-radius: var(--f7-card-expandable-border-radius)
    box-shadow: 5px 5px 10px 1px rgba(0,0,0,0.1)
    background-color: "=props.bgcolor ? props.bgcolor : ''"
    height: 180px
    margin-left: 5px
    margin-right: 5px
slots:
  content:
    - component: f7-block
      config:
        style:
          position: absolute
          top: -5px
          left: 16px
          flex-direction: row
          display: flex
      slots:
        default:
          - component: f7-icon
            config:
              f7: =props.icon
              size: 18
              style:
                margin-right: 10px
              visible: "=props.icon ? true : false"
          - component: Label
            config:
              text: "=props.title ? props.title : ''"
              style:
                font-size: 12px
                margin-top: 0px
    - component: f7-block
      config:
        style:
          flex-direction: row
          left: 10px
          position: absolute
          top: 50px
      slots:
        default:
          - component: Label
            config:
              style:
                font-size: 17px
                font-weight: 600
                margin-left: 0px
                margin-top: 0px
              text: "=props.header ? props.header : 'Set Props'"
    - component: f7-block
      config:
        class:
          - display-flex
          - flex-direction-column
          - justify-content-flex-end
        style:
          animation: f7-fade-in 300ms
          top: 50px
          margin-top: 10px
          margin-left: 0px
          width: calc(100% - 40px)
      slots:
        default:
          - component: f7-row
            config:
              class:
                - display-flex
                - justify-content-space-between
                - align-items-center
              style:
                margin-left: -10px
                left: 20px
                width: calc(100% + 20px)
            slots:
              default:
                - component: f7-icon
                  config:
                    f7: thermometer
                    size: 20
                    style:
                      color: var(--f7-block-header-text-color)
                - component: Label
                  config:
                    style:
                      color: var(--f7-block-header-text-color)
                    text: =items[props.item_warmth].state + "K"
          - component: f7-row
            config:
              class:
                - display-flex
                - justify-content-center
                - align-items-center
              style:
                width: 100%
            slots:
              default:
                - component: oh-slider
                  config:
                    color: white
                    item: =props.item_warmth
                    label: true
                    max: 10000
                    min: 1000
                    style:
                      --f7-range-bar-active-bg-color: transparent
                      --f7-range-bar-bg-color: linear-gradient(to right, rgba(246,158,81,0.8), rgba(246,158,81,0))
                      --f7-range-bar-border-radius: 10px
                      --f7-range-bar-size: 18px
                      --f7-range-knob-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3)
                      --f7-range-knob-size: 20px
                      --f7-range-label-text-color: black
                      width: 100%
                      z-index: 99 !important
          - component: f7-row
            config:
              class:
                - display-flex
                - justify-content-space-between
                - align-items-center
              style:
                margin-left: -10px
                width: calc(100% + 20px)
            slots:
              default:
                - component: f7-icon
                  config:
                    f7: sun_min
                    size: 20
                    style:
                      color: var(--f7-block-header-text-color)
                - component: Label
                  config:
                    style:
                      color: var(--f7-block-header-text-color)
                    text: =items[props.item_brightness].state + "%"
          - component: f7-row
            config:
              class:
                - display-flex
                - justify-content-center
                - align-items-center
              style:
                width: 100%
            slots:
              default:
                - component: oh-slider
                  config:
                    color: white
                    item: =props.item_brightness
                    label: true
                    style:
                      --f7-range-bar-active-bg-color: rgba(246,246,0,0.5)
                      --f7-range-bar-bg-color: linear-gradient(to right, rgba(169,169,169,0.8), rgba(246,158,81,0))
                      --f7-range-bar-border-radius: 10px
                      --f7-range-bar-size: 18px
                      --f7-range-knob-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3)
                      --f7-range-knob-size: 20px
                      --f7-range-label-text-color: black
                      width: 100%
                      z-index: 99 !important
    - component: oh-toggle
      config:
        item: =props.item_schalter
        style:
          position: absolute
          top: 15px
          right: 20px

But after configuring it I get this:

slider

Everything else works just fine.

Further information:

Raspberry Pi 4

  • Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz
  • 8GB LPDDR4-3200 SDRAM (depending on model)
  • Working currently on wireless 2.4Ghz, but thinking about putting it on ethernet cable

Raspberry Pi OS

  • OpenHAB 3.3.0
  • Alexa Echo Dot v4
  • Elgin Smart Color

Can someone help me figure it out?
Thank you for reading till here!

Regards,

What do your logs show? This behavior certainly looks like the value being sent by the slider is either not what you are expecting (unit conversion issue?) or is invalid and so it doesn’t get passed from the item to the binding which means it reverts back to it’s old value when the binding updates the item. Without seeing the log files when you move the slider it’s hard to tell the difference.

Hi, @JustinG I didn’t know there was a log, my bad, I could retrieve this on the logs:

==> /var/log/openhab/events.log <==
2022-03-01 11:33:11.965 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Saladejogoslampada_ColorTemperatureInKelvin' received command 5258
2022-03-01 11:33:11.967 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Saladejogoslampada_ColorTemperatureInKelvin' predicted to become 5258
2022-03-01 11:33:11.970 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Saladejogoslampada_ColorTemperatureInKelvin' changed from 10000 to 5258

==> /var/log/openhab/openhab.log <==
2022-03-01 11:33:13.879 [WARN ] [mazonechocontrol.internal.Connection] - Smart home device command failed. The request '{"controlRequests":[{"entityId":"ef7c344c-8bc4-48f1-9f37-a1ee38321384","entityType":"APPLIANCE","parameters":{"action":"setColorTemperature","colorTemperatureInKelvin":5258}}]}' resulted in error(s): {"entity":{"entityId":"ef7c344c-8bc4-48f1-9f37-a1ee38321384","entityType":"APPLIANCE"},"code":"FAILURE_TO_SEND","message":"Validation failed with the following error(s): [InvalidParameters: [StringParameter(value=5258)] for action setColorTemperature]","data":null}

==> /var/log/openhab/events.log <==
2022-03-01 11:33:14.484 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Saladejogoslampada_ColorTemperatureInKelvin' changed from 5258 to 10000

==> /var/log/openhab/openhab.log <==
2022-03-01 11:33:19.205 [INFO ] [control.internal.WebSocketConnection] - Web Socket close 1005. Reason: null
2022-03-01 11:34:22.391 [INFO ] [control.internal.WebSocketConnection] - Web Socket close 1005. Reason: null

Does it ring any bells?
Thank you for the reply!

As I suspected there’s something about the way the slider sends the command that is invalid according to the binding controlling your bulbs.

I don’t work with bulbs much so I can’t be more specific than that. Search around the forums o see if anyone else with your type of bulb has had a similar issue. Also search the forum for error matching the one you are seeing here.

I would also suggest some testing to see if the issue is the binding or the slider. Can you make a widget button that sends just one value correctly to the bulbs when pressed? If so, what does that command have to be formatted like?

So I found out the issue, is quite simple, as the bulb is a skill from Alexa, it gave me too few options than I think it was a stand-alone binding, here the difference between the apps.

Alexa:

Smart Life:

Even though Alexa cannot reach the full potential from the lightbulb command itself maybe be possible to play around with it.
Also to change color, had to change the values from Color Name and Color Temperature Name, which is a little bit strange, but that is how Alexa works.

I will work now on a widget that can work with this, maybe also on hexadecimal to the color name.

Thanks for helping to find it and also how to get logs, I was not sure if it was possible.

Now that I have time I’ve created a new widget to work with Alexa, feel free to add any improvements.
But I cannot use full lightbulb potential

image

Code:

uid: Cell_Light_Card_1
tags: []
props:
  parameters:
    - description: Small title on top of the card
      label: Title
      name: title
      required: false
      type: TEXT
    - description: Header big sized
      label: Header
      name: header
      required: false
      type: TEXT
    - description: Icon on top of the card (only f7 icons (without f7:))
      label: Icon
      name: icon
      required: false
      type: TEXT
    - description: rgba or HEX
      label: Background Color
      name: bgcolor
      required: false
      type: TEXT
    - context: item
      description: Item to control on/off
      label: Item
      name: item_schalter
      required: false
      type: TEXT
    - context: item
      description: Item to control brightness
      label: Item
      name: item_brightness
      required: false
      type: TEXT
    - context: item
      description: Item to control Color
      label: Item
      name: item_color
      required: false
      type: TEXT
  parameterGroups: []
timestamp: Mar 6, 2022, 3:43:02 PM
component: f7-card
config:
  style:
    background-color: "=props.bgcolor ? props.bgcolor : ''"
    border-radius: var(--f7-card-expandable-border-radius)
    box-shadow: 5px 5px 10px 1px rgba(0,0,0,0.1)
    height: 180px
    margin-left: 5px
    margin-right: 5px
    noShadow: false
    padding: 0px
slots:
  content:
    - component: f7-block
      config:
        style:
          display: flex
          flex-direction: row
          left: 16px
          position: absolute
          top: -5px
      slots:
        default:
          - component: f7-icon
            config:
              f7: =props.icon
              size: 18
              style:
                margin-right: 10px
              visible: "=props.icon ? true : false"
          - component: Label
            config:
              style:
                font-size: 12px
                margin-top: 0px
              text: "=props.title ? props.title : ''"
    - component: f7-block
      config:
        style:
          flex-direction: row
          left: 10px
          position: absolute
          top: 50px
      slots:
        default:
          - component: Label
            config:
              style:
                font-size: 17px
                font-weight: 600
                margin-left: 0px
                margin-top: 0px
              text: "=props.header ? props.header : 'Set Props'"
    - component: f7-block
      config:
        class:
          - display-flex
          - flex-direction-column
          - justify-content-flex-end
        style:
          animation: f7-fade-in 300ms
          margin-left: 0px
          margin-top: 10px
          position: absolute
          top: 70px
          width: 85%
      slots:
        default:
          - component: f7-row
            config:
              class:
                - display-flex
                - justify-content-space-between
                - align-items-center
              style:
                left: 20px
                margin-left: -10px
                width: calc(100% - 50px)
            slots:
              default:
                - component: f7-icon
                  config:
                    f7: thermometer
                    size: 20
                    style:
                      color: var(--f7-block-header-text-color)
                      top: 7px
          - component: f7-row
            config:
              class:
                - display-flex
                - justify-content-center
                - align-items-center
              style:
                width: 100%
            slots:
              default:
                - component: oh-button
                  config:
                    action: command
                    actionCommand: warm_white
                    actionItem: =props.item_color
                    style:
                      background-color: "#dc8816"
                      height: 33px
                      left: 25px
                      position: absolute
                      top: 0px
                      width: 20%
                - component: oh-button
                  config:
                    action: command
                    actionCommand: soft_white
                    actionItem: =props.item_color
                    style:
                      background-color: "#e29c44"
                      height: 33px
                      left: 21%
                      position: absolute
                      top: 0px
                      width: 20%
                - component: oh-button
                  config:
                    action: command
                    actionCommand: white
                    actionItem: =props.item_color
                    style:
                      background-color: "#eec692"
                      height: 33px
                      left: 40%
                      position: absolute
                      top: 0px
                      width: 20%
                - component: oh-button
                  config:
                    action: command
                    actionCommand: daylight_white
                    actionItem: =props.item_color
                    style:
                      background-color: "#f5e6d3"
                      height: 33px
                      left: 59%
                      position: absolute
                      top: 0px
                      width: 20%
                - component: oh-button
                  config:
                    action: command
                    actionCommand: cool_white
                    actionItem: =props.item_color
                    style:
                      background-color: "#f2f1ff"
                      height: 33px
                      left: 78%
                      position: absolute
                      top: 0px
                      width: 20%
          - component: f7-row
            config:
              class:
                - display-flex
                - justify-content-space-between
                - align-items-center
              style:
                margin-left: -10px
                margin-top: 20px
                width: calc(100% + 20px)
            slots:
              default:
                - component: f7-icon
                  config:
                    f7: sun_min
                    size: 20
                    style:
                      color: var(--f7-block-header-text-color)
                - component: Label
                  config:
                    style:
                      color: var(--f7-block-header-text-color)
                    text: =items[props.item_brightness].state + "%"
          - component: f7-row
            config:
              class:
                - display-flex
                - justify-content-center
                - align-items-center
              style:
                width: 100%
            slots:
              default:
                - component: oh-slider
                  config:
                    color: white
                    item: =props.item_brightness
                    label: true
                    style:
                      --f7-range-bar-active-bg-color: rgba(246,246,0,0.5)
                      --f7-range-bar-bg-color: linear-gradient(to right, rgba(169,169,169,0.8), rgba(246,158,81,0))
                      --f7-range-bar-border-radius: 10px
                      --f7-range-bar-size: 18px
                      --f7-range-knob-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3)
                      --f7-range-knob-size: 20px
                      --f7-range-label-text-color: black
                      width: 100%
                      z-index: 99 !important
    - component: oh-button
      config:
        action: command
        actionCommand: red
        actionItem: =props.item_color
        iconColor: red
        iconF7: app_fill
        iconSize: 25
        style:
          background: transparent
          height: 25px
          padding: 0px
          margin: 0px
          position: absolute
          right: 45px
          top: 10px
    - component: oh-button
      config:
        action: command
        actionCommand: crimson
        actionItem: =props.item_color
        iconF7: app_fill
        iconSize: 25
        style:
          background: transparent
          color: "#cc3730"
          height: 25px
          padding: 0px
          margin: 0px
          position: absolute
          right: 45px
          top: 30px
    - component: oh-button
      config:
        action: command
        actionCommand: salmon
        actionItem: =props.item_color
        iconF7: app_fill
        iconSize: 25
        style:
          background: transparent
          color: "#dd9366"
          height: 25px
          padding: 0px
          margin: 0px
          position: absolute
          right: 45px
          top: 50px
    - component: oh-button
      config:
        action: command
        actionCommand: orange
        actionItem: =props.item_color
        iconF7: app_fill
        iconSize: 25
        style:
          background: transparent
          color: "#ffa600"
          height: 25px
          padding: 0px
          margin: 0px
          position: absolute
          right: 45px
          top: 70px
    - component: oh-button
      config:
        action: command
        actionCommand: gold
        actionItem: =props.item_color
        iconF7: app_fill
        iconSize: 25
        style:
          background: transparent
          color: "#fed500"
          height: 25px
          padding: 0px
          margin: 0px
          position: absolute
          right: 45px
          top: 90px
    - component: oh-button
      config:
        action: command
        actionCommand: yellow
        actionItem: =props.item_color
        iconF7: app_fill
        iconSize: 25
        style:
          background: transparent
          color: "#fefc00"
          height: 25px
          padding: 0px
          margin: 0px
          position: absolute
          right: 45px
          top: 110px
    - component: oh-button
      config:
        action: command
        actionCommand: green
        actionItem: =props.item_color
        iconF7: app_fill
        iconSize: 25
        style:
          background: transparent
          color: "#00ff01"
          height: 25px
          padding: 0px
          margin: 0px
          position: absolute
          right: 45px
          top: 130px
    - component: oh-button
      config:
        action: command
        actionCommand: turquoise
        actionItem: =props.item_color
        iconF7: app_fill
        iconSize: 25
        style:
          background: transparent
          color: "#48feed"
          height: 25px
          padding: 0px
          margin: 0px
          position: absolute
          right: 20px
          top: 10px
    - component: oh-button
      config:
        action: command
        actionCommand: cyan
        actionItem: =props.item_color
        iconF7: app_fill
        iconSize: 25
        style:
          background: transparent
          color: "#00fefc"
          height: 25px
          padding: 0px
          margin: 0px
          position: absolute
          right: 20px
          top: 30px
    - component: oh-button
      config:
        action: command
        actionCommand: blue
        actionItem: =props.item_color
        iconF7: app_fill
        iconSize: 25
        style:
          background: transparent
          color: "#0000ff"
          height: 25px
          padding: 0px
          margin: 0px
          position: absolute
          right: 20px
          top: 50px
    - component: oh-button
      config:
        action: command
        actionCommand: purple
        actionItem: =props.item_color
        iconF7: app_fill
        iconSize: 25
        style:
          background: transparent
          color: "#ab23fd"
          height: 25px
          padding: 0px
          margin: 0px
          position: absolute
          right: 20px
          top: 70px
    - component: oh-button
      config:
        action: command
        actionCommand: magenta
        actionItem: =props.item_color
        iconF7: app_fill
        iconSize: 25
        style:
          background: transparent
          color: "#fd00fe"
          height: 25px
          padding: 0px
          margin: 0px
          position: absolute
          right: 20px
          top: 90px
    - component: oh-button
      config:
        action: command
        actionCommand: pink
        actionItem: =props.item_color
        iconF7: app_fill
        iconSize: 25
        style:
          background: transparent
          color: "#ffbfcd"
          height: 25px
          padding: 0px
          margin: 0px
          position: absolute
          right: 20px
          top: 110px
    - component: oh-button
      config:
        action: command
        actionCommand: lavander
        actionItem: =props.item_color
        iconF7: app_fill
        iconSize: 25
        style:
          background: transparent
          color: "#9f80ff"
          height: 25px
          padding: 0px
          margin: 0px
          position: absolute
          right: 20px
          top: 130px
    - component: oh-toggle
      config:
        item: =props.item_schalter
        style:
          position: absolute
          right: 95px
          top: 15px

I also need to create a thing with both ColorName and ColorTemperatureName

Best regards!