Element click action gives "Uncaught ReferenceError: domain is not defined"

I’m trying to make a remote control with clickable buttons in Floorplan, latest version of that and Hass.io. It seems like the buttons should be elements, not entities, so here’s my floorplan.yaml:

name: Remote
image: /local/custom_ui/floorplan/remote.svg
stylesheet: /local/custom_ui/floorplan/floorplan.css

warnings:

groups:
  - name: Buttons
    elements:
      - power
    action:
      domain: switch
      service: broadlink_send_packet_192_168_1_240
      data:
        packet: !secret power

The rect with that id is clickable alright, but I’m getting only a red message:

* Uncaught ReferenceError: domain is not defined
URL: https://example.com:8123/local/custom_ui/floorplan/ha-floorplan.html
Line: 745, column: 22
Error: {}

I’m not sure about the config, nor am I sure that I’m not missing some JavaScript intricacy. Either case, an explanation or fix would be much welcome. Thanks!

For the future, this pull request fixes the problem.

1 Like