Hi there, brand new to this picture-elements card, and loving what it can do, but I’m running in to some errors, and for the life of me, I can’t figure out where I am going wrong.
first, the code:
#rats. only some lights work
type: picture-elements
image: /local/images/1floorGUI/bg_dark.png
elements:
- type: image
entity: light.front_porch
tap_action: none
hold_action: none
style:
left: 50%
top: 50%
width: 100%
state_image:
"on": /local/images/1floorGUI/light_front_door.png
"off": /local/images/1floorGUI/bg_transparent.png
unavailable: /local/images/1floorGUI/bg_transparent.png
- type: image
entity: light.dimmable_light_1
tap_action: none
style:
top: 50%
left: 50%
width: 100%
state_image:
"on": /local/images/1floorGUI/light_side_patio.png
"off": /local/images/1floorGUI/bg_transparent.png
unavailable: /local/images/1floorGUI/bg_transparent.png
- type: image
entity: switch.plug_in_outdoor_smart_switch
tap_action: none
hold_action: none
style:
left: 50%
top: 50%
width: 100%
state_image:
"on:": /local/images/1floorGUI/light_patio_party_lights.png
"off": /local/images/1floorGUI/bg_transparent.png
"unavailable": /local/images/1floorGUI/bg_transparent.png
- type: image
entity: switch.ge_enbrighten_z_wave_plus_smart_switch
tap_action: none
hold_action: none
style:
left: 50%
top: 50%
width: 100%
state_image:
"on:": /local/images/1floorGUI/light_back_porch.png
"off": /local/images/1floorGUI/bg_transparent.png
"unavailable": /local/images/1floorGUI/bg_transparent.png
#ceiling fan images
- type: image
entity: fan.ar_ceiling_fan
tap_action: none
hold_action: none
style:
left: 50%
top: 17%
width: 5%
state_image:
"on": /local/images/1floorGUI/anim_fan_slow.png
"off": /local/images/1floorGUI/still_fan.png
"unavailable": /local/images/1floorGUI/bg_transparent.png
- type: image
entity: fan.kitchen_ceiling_fan
tap_action: none
hold_action: none
style:
left: 56%
top: 45%
width: 5%
state_image:
"on": /local/images/1floorGUI/anim_fan_slow.png
"off": /local/images/1floorGUI/still_fan.png
"unavailable": /local/images/1floorGUI/bg_transparent.png
- type: image
entity: fan.family_room_fan
tap_action: none
hold_action: none
style:
left: 77%
top: 27%
width: 5%
state_image:
"on": /local/images/1floorGUI/anim_fan_slow.png
"off": /local/images/1floorGUI/still_fan.png
"unavailable": /local/images/1floorGUI/bg_transparent.png
#toggles
- type: image
entity: light.front_porch
tap_action:
action: toggle
style:
left: 5%
top: 30%
width: 5%
height: 5%
border: 1px dotted gray
state_image:
"on": /local/images/1floorGUI/bg_transparent.png
"off": /local/images/1floorGUI/bg_transparent.png
unavailable: /local/images/1floorGUI/unavailable.png
- type: image
entity: light.dimmable_light_1
tap_action:
action: toggle
style:
top: 63%
left: 77.5%
width: 5%
border: 1px dotted gray
state_image:
"on": /local/images/1floorGUI/bg_transparent.png
"off": /local/images/1floorGUI/bg_transparent.png
unavailable: /local/images/1floorGUI/unavailable.png
- type: image
entity: switch.plug_in_outdoor_smart_switch
tap_action:
action: toggle
style:
left: 70%
top: 95.5%
width: 30%
height: 6%
border: 1px dotted gray
state_image:
"on:": /local/images/1floorGUI/bg_transparent.png
"off": /local/images/1floorGUI/bg_transparent.png
"unavailable": /local/images/1floorGUI/unavailable.png
- type: image
entity: switch.ge_enbrighten_z_wave_plus_smart_switch
tap_action:
action: toggle
style:
left: 95%
top: 25%
width: 5%
border: 1px dotted gray
state_image:
"on:": /local/images/1floorGUI/bg_transparent.png
"off": /local/images/1floorGUI/bg_transparent.png
"unavailable": /local/images/1floorGUI/unavailable.png
#ceiling fan toggles
- type: image
entity: fan.ar_ceiling_fan
tap_action:
action: more-info
style:
left: 50%
top: 17%
width: 3%
height: 5%
# border: 1px dotted gray
state_image:
"on": /local/images/1floorGUI/bg_transparent.png
"off": /local/images/1floorGUI/bg_transparent.png
"unavailable": /local/images/1floorGUI/unavailable.png
- type: image
entity: fan.kitchen_ceiling_fan
tap_action:
action: more-info
style:
left: 56%
top: 45%
width: 3%
height: 5%
# border: 1px dotted gray
state_image:
"on": /local/images/1floorGUI/bg_transparent.png
"off": /local/images/1floorGUI/bg_transparent.png
"unavailable": /local/images/1floorGUI/unavailable.png
- type: image
entity: fan.family_room_fan
tap_action:
action: more-info
style:
left: 77%
top: 27%
width: 3%
height: 5%
# border: 1px dotted gray
state_image:
"on": /local/images/1floorGUI/bg_transparent.png
"off": /local/images/1floorGUI/bg_transparent.png
"unavailable": /local/images/1floorGUI/unavailable.png
you’ll see that I’ve left little gray boxes around the toggle locations for now, just so I can get used to the locations where I should be tapping.
Here you can see my lights off, but a fan running (it animates, thanks to the wonder of animated PNG files)
.
I can toggle light.dimmable_light_1
and light.front_porch
and the lights come on:
but the moment I try toggling switch.plug_in_outdoor_smart_switch
or switch.ge_enbrighten_z_wave_plus_smart_switch
I get the spinning blue circles in my picture-elements card indicating that something is broken with my syntax or request. The actual light switches do toggle when I click the image, and the spinning blue circles remain until I toggle them off again. If I physically control the switches to turn them on, I get the spinning blue circles (here I tried turning on the enbrighten.)
This tells me that at least the logic is okay for the toggles, but something is wrong when I try to load the PNG image of the light when it is in its “on” state.
I’ve double checked that the PNG will load by flipping its on and off images:
- type: image
entity: switch.plug_in_outdoor_smart_switch
tap_action: none
hold_action: none
style:
left: 50%
top: 50%
width: 100%
state_image:
"on:": /local/images/1floorGUI/bg_transparent.png
"off": /local/images/1floorGUI/light_patio_party_lights.png
"unavailable": /local/images/1floorGUI/bg_transparent.png
and I see the below image when the light is turned off, but I see the spinning blue circle when I turn it on, telling me that at least my PNG is fine:
Any suggestions are welcome. I have 14 other lights not listed in this setup, and all of them are giving an error (they are all light. entities, not switch.entities,) even when I try to use them just as an indicator like this, with only the single light on the card and no toggles, the moment I turn one of the other lights on, I get blue circles:
type: picture-elements
image: /local/images/1floorGUI/bg_dark.png
elements:
- type: image
entity: light.living_room_ceiling
tap_action: none
hold_action: none
style:
left: 50%
top: 50%
width: 100%
state_image:
"on:": /local/images/1floorGUI/light_living_room_ceiling.png
"off": /local/images/1floorGUI/bg_transparent.png
"unavailable": /local/images/1floorGUI/bg_transparent.png