The floorplan can be JPG to the best of my knowledge but any image/icon you want to click/touch will need to be SVG.
I see.
Still do not understand why it works with mouse, but not touch
I took out the JPG, now my floorplan has only imported SVG (lamps, media_playe and so on).
It works perfectly on browser (with mouse when I go on an object I click and it shows camera image if is an image), but with TOUCH is not working, so unusable on smartphone/tablet.
What am I doing wrong???
I initially had the same problem and eventually moved to creating a box around the lamps, bulbs etc and tied the entity to the box. The problem for me was for the touch to work on a lamp or bulb you had to hit the exact spot perfectly. With creating and using a box I had a larger area to use for touch. Not sure if this is a similar problem for you but you may want to consider it. I actually have now moved away from this approach completely but initially struggled with this in the beginning. Good luck!
thanks will do as suggested. What do you do now?
Lol, I am actually on my 4th revision of my floorplan layout. I started out with a detailed floor layout of my home with many of the same ideas of adding lamps, lights, room layouts etc. My 2nd version was a more simplified version of that but I quickly realized my ultimate goal of using tablets, specifically the 7" FireHD, those ideas were too cluttered so I moved to just having boxes for each of my lights. I split it it into a floorplan for the first floor and a separate one for the second floor. Again however I was trying to put too much into the tablet view so I am currently trying to once again simplify. I had been waiting for a new version of the floorplan to be released that included pages as I think this might solve some of my problems but haven’t seen that released yet so I am trying to do something with showing/hiding layers.
No it’s not this. I made an entire room, it works with mouse and not with touch.
Strange that I am the only one with this problem
I just made that change but I’m still not seeing my floor plan under the new panel… Any other ideas?
I believe I have the same issue. I can use my floor plan and click on anything and it will function on PC but if I pull it up on iOS, ipad or tablet I get the floor plan but it is not clickable via touch only via a mouse.
in fact you can simply test it, put your Home assistant address in chrome ore firefox and add
at the end and you should see your floorplan.
so your real address, not the example I am putting below
http://your.home.assistant/local/custom_ui/floorplan/floorplan.svg
If you are not able to see it then you have another problem not related to floorplan.
Ok, I am able to see SVG using the direct url. So it appears the panel is not working.
My configuration.yaml shows the following;
panel_custom:
- name: floorplan
sidebar_title: Floorplan
sidebar_icon: mdi:home
url_path: floorplan
config: !include floorplan.yaml
The floorplan.yaml is now using the correct address;
image: /local/custom_ui/floorplan/floorplan.svg stylesheet: /local/custom_ui/floorplan/floorplan.css
The floorplan.html appears to point to this;
<link rel="import" href="/local/custom_ui/floorplan/ha-floorplan.html" async
I noticed the ‘custom_ui’ directory is a child of the parent ‘www’. Other than that oddity, I’m not sure I see the issue…
I had the same issue.
To fix it, i downloaded the zip file from the repository, extracted it, replaced the svg file with my own and placed the files into the config directory.
Got it! I didn’t realize the doc said to dump the entire rep into the config. I noticed the addons panel is now missing. Is this expected?
no, not the configuration.yaml, but i added the required configuration like:
panel_custom:
- name: floorplan
sidebar_title: Floorplan
sidebar_icon: mdi:home
url_path: floorplan
config: !include floorplan.yaml
Usually it works better if you remove the pan_zoom: if you have it on.
Thanks, tried and is a bit better. But not good enough. Project postponed
I have a question about adding the unit of measurement to the floorplan.
I’ve created a floorplan and added 9 sensor values to it:
but as you can see there are no units of measurement.
I’m using the same sensor values as in the group:
and they are there.
Question: Do you need to create a template sensor for each sensor in the floorplan? Or is it a setting i’ve missed?
You should add a text template to your floorplan config. I use this to round the values to 1 digit and add the unit;
text_template: '${entity.state ? Math.ceil(entity.state *10) /10+ "°C": "undefined"}'
Did that and it works now. Thanks. Here’s my code:
groups:
- name: temp
entities:
- sensor.sensebender_micro_1_1
- sensor.temperatuur_slaapkamer
- sensor.temperatuur_studeerkamer
text_template: '${entity.state ? entity.state : "na"}°C'
- name: ppm
entities:
- sensor.co2_woonkamer
- sensor.co2_slaapkamer
- sensor.co2_studeerkamer
text_template: '${entity.state ? entity.state : "na"} ppm'
- name: hum
entities:
- sensor.luchtvochtigheid_woonkamer
- sensor.luchtvochtigheid_slaapkamer
- sensor.luchtvochtigheid_studeerkamer
text_template: '${entity.state ? entity.state : "na"}%'
Can you please share a little bir more of the “onElementClick(e)” config? Not quite shure where excactly to put the to put the lines.