Hi all! New to this community, I decided to attempt something that was bugging me with 3D floorplans - My hue bulbs have color, and the floorplans I saw didn’t seem to do this dynamically. So here it is! My apporach to a floorplan focused minimal UI. This is a work in progress, I hope to add alot more custom gestures etc soon.
查看整个UI的视频:https://youtu.be/kcfzc1mxp_a
特征
方法和图片元素样式
This approach is heavily based on the图片元素卡for each view, and does not work in a traditional “Card” based way. Most cards include a heavy amount of styling and positioning. Some of this styling overrides the custom cards to use查看宽度因此,它们的字体,宽度和高度根据显示屏的宽度缩放,以便我可以在任何分辨率上使用界面。
I first designed my whole UI in像素机这样我就可以导出按钮图像和小米平面图覆盖图像。
映像透明。png在state_image图片元素上使用,以隐藏元素,尽管在我意识到我可以有条件地显示元素之前使用了元素
- 将尽快更新以清理。
侧边栏
Note, the sidebar is repeated across every view in the lovelace.yaml file and includes buttons for the views.
- Control Rooms: Tap a room to turn on or off all lights, hold tap to show custom controls.
- Control Lights: Tap a light icon to turn on or off individual lights, hold tap to show custom controls.
- 清理: Direct control of Xiaomi Mi robot and preset zones for room based cleanup
- All Devices: Show all devices in a familiar homekit UI, why not?
- 媒体:按钮显示当前播放媒体,如果播放,查看显示有关plex或Spotify的相关视图。
- 天气: Shows weather forecast and predicted rain from Buienradar.
我家中的硬件
- Xgimi H1 PROJECTOR
- Sound system (controlled by an IR Blaster)
- Philips Hue Bulbs
- Osram花园杆(用于屋顶,户外)
- 小米Mi机器人
- 飞利浦运动传感器
Individual hue & brightness lights
带有config-template卡的CSS的地图实体:
这种方法依赖于config-template卡。图片元素卡包裹在config-template卡中。使用的所有Entites都在配置卡上列出,因此可以将其传递给CSS中使用的模板。要了解原因,请检查:https://github.com/iantrich/config-template-card
渲染单个灯:
要在彼此上覆盖多个灯光,解决方案实际上很简单。您为每个单独的光线渲染图像,并使用CSS属性过滤器混合模式:亮光。这将确保仅显示图像的“光”部分,并将其融合到顶部的任何图像。
色相和不透明度
要将您的一个光图像映射到灯泡的实际实时RGB颜色,您可以使用以下CSS模板样式,该样式将调整色调旋转到灯泡的色调(在这种情况下为Light.Table):
样式:filter:'$ {“ hue-rotate(” +(states ['''light.table'']。属性.hs_color?states ['''leight.table']。attributes.hs_color [0]:0)+“ deg)”}'
或者,包括饱和度(我发现它很糟糕):
样式:filter:'$ {“ hue-rotate(” +(states ['''light.table'']。属性.hs_color?states ['''leight.table']。attributes.hs_color [0]:0)+“ deg)饱和(” +(状态[''light.table']。'
要将不透明度映射到实体的亮度,请使用此CSS模板:
样式:不透明:'$ {state [''light.table'']。属性.brightness / 255}'
清理
This is a custom screen made up of picture-elements that interact with the小米机器人真空分子组件。输入文本用于确定真空当前状态(清洁,返回家园等),并用于有条件地更改图片元素。
天气
我使用Buien Radar(荷兰服务)建造了一张定制卡,以在接下来的2小时内显示预计的降雨。
有关此卡的更多信息,请查看这个存储库
完整配置:
其他资源:
很大程度上有必要马蒂亚斯·珀森(Mattias Persson)
有关制作3D平面图的精彩文章,请检查一下