Simple question about Pages yaml syntax

Can somebody help why this won’t work?

              - component: oh-cell
                config:
                  action: toggle
                  actionCommand: ON
                  actionCommandAlt: OFF
                  actionItem: KNXHeizaktor_Heizen1Kuhlen0
                  color: '=(items[KNXHeizaktor_Heizen1Kuhlen0].state == "ON") ? "red" : "blue"'
                  header: Kühlen / Heizen
                  icon: '=(items.KNXHeizaktor_Heizen1Kuhlen0.state == ON) ? "oh:sun" : "oh:snow"'
                  item: KNXHeizaktor_Heizen1Kuhlen0
                  stateAsHeader: true
                  title: '=(items.KNXHeizaktor_Heizen1Kuhlen0.state == ON) ? "Heizen" : "Kühlen"'

My intention is to show a blue button, text and icon für cooling and a red one for heating:
image

Have a look e.g. at codeblock at: Cell card widget paired with expanded popup

Your code contains

versus

thank you. This works

              - component: oh-cell
                config:
                  on: true
                  action: toggle
                  actionCommand: ON
                  actionCommandAlt: OFF
                  actionItem: KNXHeizaktor_Heizen1Kuhlen0
                  color: "=(items.KNXHeizaktor_Heizen1Kuhlen0.state == 'ON') ? 'red' : 'blue'"
                  header: Kühlen / Heizen
                  icon: "=(items.KNXHeizaktor_Heizen1Kuhlen0.state == 'ON') ? 'oh:fire' :
                    'oh:snow'"
                  item: KNXHeizaktor_Heizen1Kuhlen0
                  stateAsHeader: true
                  title: "=(items.KNXHeizaktor_Heizen1Kuhlen0.state == 'ON') ? 'Heizen' :
                    'Kühlen'"
1 Like