Floorplan for Home Assistant

I think you have done something wrong in inkscape/svg editor then. If you try again:
Make some text in inkscape, and give the correct entity_id to that text. Must be in the top in the layer (not buried in multiple groups etc). Just try again, and see if it works. If you have done anything to the text (combined with the rectangle or something, it is kind of ruined).

To show the temperature multiple places, in inkscape, you just copy and paste the text to the sensor, then group those two texts, remove the entity_id from the original text, and give the group that entity_id instead.

You are right. I tray to create two new object and I grouped this object together and its working.

But I still have another problem both rectangle and text changing colors together. I only wanna have rectangle to change color and text must have always black color? How

Make a template of your sensor, then make a group in floorplan.yaml with that sensor. And for that sensor, use only the text_template. Then change the entity_id of the text in inkscape, to the template sensor.

Now changing colors not working:

I change script from this:

  • name: fp_temperature_oudside_front_changin_colors
    entities:
    • sensor.433_temperature_01_temperature
      text_template: ‘${entity.state ? entity.state : “unknown”}’
      class_template: ’
      var temp = parseFloat(entity.state.replace(“°”, “”));
      if (temp < 0)
      return “temp-freeze”;
      else if (temp < 10)
      return “temp-low”;
      else if (temp < 22)
      return “temp-mid”;
      else
      return “temp-high”;

to this:

  • name: fp_temperature_oudside_front_changin_colors
    entities:

    • sensor.433_temperature_01_temperature
      class_template: ’
      var temp = parseFloat(entity.state.replace(“°”, “”));
      if (temp < 0)
      return “temp-freeze”;
      else if (temp < 10)
      return “temp-low”;
      else if (temp < 22)
      return “temp-mid”;
      else
      return “temp-high”;
  • name: fp_temperature_oudside_front_to_text
    entities:

    • sensor.433_temperature_01_temperature
      text_template: ‘${entity.state ? entity.state : “unknown”}’

I understant I have to make another template and connect it to text object.

But there is no solution to do that with only one id?

unfortunately, not as far I know. You can do it with switches by having one switch in a group, then use the group as the other entity_id in the svg. But that’s not possible with sensors. What I do is just make the text change colour instead.
The problem is that you tell that this entity_id should change colours, but what you want is that one of them should change colours, and one of them not. You could use stroke fill instead of fill, then group them, and have just one entity_id on them (then the fill colour of the rectangle would stay the same and just the text and stroke on the rectangle change) but I haven’t testet if this works myself.

Can you help me with this:

https://community.home-assistant.io/t/template-temperature-sensor-error/49055

I don’t see what is wrong with template :rage:

I test with stroke and fill but not working.

In floorplan-css:

Change from fill to stroke like this:

.temp-high {
  fill: #00f02dff !important;
}

to:

.temp-high {
  stroke: #00f02dff !important;
}

Just change the stroke-with in inkscape to have it as thick as you want.
And group rectangle and text template, then give the group the entity_id name.

Then you get colours at both the text and the outlines of your rectangle with one entity id.

It is possible to have one main floorplan for complete apartment and then separate detailed floorplan for each room. When I click on chosen room on main floorplan I get floorplan of room? How?

@lpt2007 checkout following thread

1 Like

Thanks. I will try that.

Hi @Zepixir, is there a way to call out a service?? I would like to have separate icon to control my cover up/close/down instead of the traditional popup menu

Yes, absolutely.
The action part in floorplan.yaml control what action to take.
Like this for my zwave thermostat:

    - name: Varme Zwave
      entities:
         - switch.termostat_stue_switch_svg
      states:
        - state: 'on'
          class: 'heat-on'
        - state: 'off'
          class: 'heat-off'
      action:
        domain: switch   # This optional parameter allows you to use other services such as homeassistant.toggle like here.
        service: toggle

If the action part is missing, the pop-up info window shows up instead.

You probably want to make 3 scripts that do the actions you want, then give the entity_id of that scripts to the buttons you make in your svg-file.

1 Like

thanks for the info. i will give it a try!!

I just upgraded to HA 0.65.6 and the latest version of Floorplan. I have three floor plans set up where I used to be able to click entities to toggle input_booleans. Now all three of them are showing the more-info window instead. I have actions defined for each entity. Does anyone have any idea what could be causing this?

have you tried to go back to the old version of floorplan, to check if it’s the html-document that does it?

I’m working on my floorplan for my house, this is what I have so far. Appreciate your feedback

5 Likes

What did you use to create that svg?

I did replace ha-floorplan.html and state-card-floorplan.html with older versions but it didn’t help. What are the dates on the files you are using?

I am getting this error in Chrome when I click on the svg even though everything works.

image