找回密码
 立即注册
查看: 604|回复: 13

[新奇玩法] 继真三维的设备控制与展示后,新增了开源小程序的玩法

[复制链接]

2

主题

53

回帖

377

积分

论坛技术达人

积分
377
金钱
317
HASS币
20
QQ
发表于 2025-3-16 10:54:55 | 显示全部楼层 |阅读模式
本帖最后由 hawk86104 于 2025-3-16 11:03 编辑

上次发帖的是:已更新包|真三维版本的设备控+电视机画面+免费开源插件...https://bbs.hassbian.com/thread-28378-1-1.html】 收到了 大家的好评于是这段时间把这部分内容带到了 微信小程序端, 就是除了能用ha控制家庭设备外,你也可以通过微信小程序(用uniapp实现的,原则上所有小程序和app端都可以实现)


先上预览:
微信可以先扫码直接预览:
m-eDigitalHomedemo.png
下面是预览图效果:
11.png 22.png 33.png 44.png

同样是免费开源的,交给喜欢的大佬们折腾:
小程序的开源地址是:https://gitee.com/ice-gl/uni-app-tvt
基座的开源地址是:https://www.icegl.cn/tvtstore/freeDigitalHome

第一部分在ha的方法我就不赘述了,想见我第一个帖子:https://bbs.hassbian.com/thread-28378-1-1.html

那么实现在小程序端的方法是:
1、首先拿到之前的预览地址:
http://192.168.18.170:8123/local/tvt/index.html#/plugins/freeDigitalHome/linkWebsocket
2、当然就是有些小程序的开发基础或者uniapp的开发基础,把这个小程序启动起来:
粗略教程:https://www.icegl.cn/tvtstore/uniAppView.html
3、跑起来后,就是调试和发布了

都是免费开源的,如遇到问题,直接留言。

该有的都会有的
回复

使用道具 举报

168

主题

2521

回帖

8378

积分

元老级技术达人

积分
8378
金钱
5684
HASS币
30
发表于 2025-3-16 12:05:25 | 显示全部楼层
直接在微信里,用网址打开,有什么区别
回复

使用道具 举报

2

主题

53

回帖

377

积分

论坛技术达人

积分
377
金钱
317
HASS币
20
QQ
 楼主| 发表于 2025-3-16 13:34:54 | 显示全部楼层
bugensui 发表于 2025-3-16 12:05
直接在微信里,用网址打开,有什么区别

就是微信小程序和web端的区别。 一套代码 多端使用。
该有的都会有的
回复

使用道具 举报

62

主题

287

回帖

5787

积分

元老级技术达人

积分
5787
金钱
5423
HASS币
100
发表于 2025-3-16 15:26:06 | 显示全部楼层
不管是直接用threejs还是套你的框架,集成到ha要解决的首要问题都是1. 降低配置门槛 2. 解决交互设计问题 3. 针对移动端进行优化。不花时间解决这些问题就不可能打入这块“市场”。不过这一块看不到什么商业的空间,这个“市场”存不存在都不好说。你的重心若不在这一块,恐怕后继无人。
回复

使用道具 举报

2

主题

53

回帖

377

积分

论坛技术达人

积分
377
金钱
317
HASS币
20
QQ
 楼主| 发表于 2025-3-16 16:13:05 | 显示全部楼层
ryanh7 发表于 2025-3-16 15:26
不管是直接用threejs还是套你的框架,集成到ha要解决的首要问题都是1. 降低配置门槛 2. 解决交互设计问题 3 ...

您说的中肯
本来这块论坛难道是奔着商业盈利来玩的嘛? 不都是发烧友一起折腾玩的 不是嘛
至于盈利这块 我们的框架不是通过这种方式盈利的。

然后 回答您这几点
这块我们确实没有下游下层做配置,因为需要不少工作量,如果有更多玩家会花更多时间。
交互设计问题 和 移动端的这部分 其实这小程序 现在的交互性就是 抛砖引玉的。
还有这个市场不市场的,我们是开源的框架,所以什么行业都会涉及到,都会去尝试。如果市场中存在看好的开发者,一同继续探索,就会继续挖掘哈。 而且本身在这个论坛里发,就有相关的厂家联系到了,只是目前还不成型哈。

这本是国内三维开源的尝试,也没问任何人要一分钱。
该有的都会有的
回复

使用道具 举报

2

主题

25

回帖

549

积分

高级会员

积分
549
金钱
522
HASS币
0
发表于 2025-3-16 16:29:54 | 显示全部楼层
本帖最后由 kkzxsews 于 2025-3-16 16:32 编辑

我也感觉这块没什么市场 我个人玩HA的乐趣就在于自己瞎折腾 付费的话等于是直接跳过折腾快进到索然无味 那还玩啥
不过还是感谢楼主分享 之前你开源的插件我自己打包后已经用上了 比我自己原先瞎折腾的floor3d-card好看多了

优点是替换模型方便  缺点是缝合怪代码 可能含有未知bug

使用方法跟普通HA插件一样  把文件夹放入 下载压缩包放入 local/community目录下解压
修改configuration.yaml文件引入main-a15cb57a.js
lovelace:
  mode: yaml
#   #css: /local/lovelace.css
  resources:
    [

      {url: http://xxx.xxx.xxx.xxx:8123/local/community/tvt/assets/main-a15cb57a.js,    type: module},

    ]
然后配置仪表盘
views:
  - title: Home
    cards:
      - type: custom:my-element
        basepath: http://xxx.xxx.x.xxx:8123/local/community/tvt
        name: Home
        height: 1000px
        width: 80vh
        ambient:
          position:
            - 1
            - 5
            - 0
          intensity: 1
          distance: 10
          decay: 0.5
        obj:
          objfile: 2024room.glb
          obj_position:
            - -7
            - 0
            - -4
          obj_scale: 0.013
          obj_rotation:
            - 0
            - 0
            - 0
        camera_position:
          - 15
          - 15
          - 15
        camera_rotate:
          x: -1.0930244719682243
          'y': 0.5200808414019678
          z: 0.7648717152512469
        camera_target:
          x: 37.36890424945437
          'y': 18.64464320782064
          z: -82.55051697031719
        object_groups:
          - object_group: RoundTable
            objects:
              - object_id: Round_table_1
              - object_id: Round_table_2
              - object_id: Round_table_3
          - object_group: EntranceDoor
            objects:
              - object_id: Door_9
              - object_id: Door_7
              - object_id: Door_5
        roomList:
          - room:
              text: 客厅
              rotation:
                - 1.5707963267948966
                - 3.141592653589793
                - -1.5707963267948966
              size: 0.5
              font: >-
                http://192.168.0.100:8123/local/community/tvt/plugins/freeDigitalHome/fonts/FZLanTingHeiS-UL-GB_Regular.json
              position:
                - -3.2
                - 1.2
                - 2
            temperature:
              text: 23°C
              rotation:
                - 1.5707963267948966
                - 3.141592653589793
                - -1.5707963267948966
              size: 0.5
              font: >-
                http://192.168.0.100:8123/local/community/tvt/plugins/freeDigitalHome/fonts/FZLanTingHeiS-UL-GB_Regular.json
              position:
                - -2.2
                - 0.2
                - 2
              entity_id: climate.208907216428121_climate
              attr: current_temperature
        lightList:
          - light: light.leishi_eps127_372b_light
            model: Sphere_104_689
            class: cLeft
            style: bedB
            color: '#ffa66b'
            intensity: 10
            distance: 4
            decay: 2.8
            name: 一楼客厅灯
            position:
              - 0
              - 0
              - 0
          - light: switch.babai_202m_36b1_right_switch_service
            model: Sphere_104_693
            class: cRight
            style: ''
            color: '#D485FF'
            intensity: 10
            distance: 4
            decay: 2.8
            name: 餐厅灯
            position:
              - -2.2
              - 1.8
              - 3.3
          - light: switch.babai_203m_66f2_left_switch_service
            model: Sphere_104_681
            class: cLeft
            style: bedA
            color: '#FFEE99'
            intensity: 10
            distance: 4
            decay: 2.8
            name: 玄关灯
            position:
              - 0
              - 0
              - 0
          - light: switch.babai_ah4m_ee33_first_switch_service
            model: Sphere_104_677
            class: cRight
            style: bedB
            color: '#ffa66b'
            intensity: 10
            distance: 4
            decay: 2.8
            name: 厨房灯
            position:
              - 0
              - 0
              - 0
          - light: light.leishi_eps127_1914_light
            model: Sphere_104_669
            class: cRight
            style: ''
            color: '#D485FF'
            intensity: 10
            distance: 4
            decay: 2.8
            name: 一楼主卧灯
            position:
              - 0
              - 0
              - 0
          - light: switch.babai_201m_91e5_switch
            model: Sphere_104_673
            class: cLeft
            style: bedA
            color: '#FFEE99'
            intensity: 10
            distance: 4
            decay: 2.8
            name: 浴室柜灯
            position:
              - 0
              - 0
              - 0
          - light: switch.babai_202m_36a0_left_switch_service
            model: Sphere_104_697
            class: cRight
            style: bedB
            color: '#ffa66b'
            intensity: 10
            distance: 4
            decay: 1
            name: 二楼厅灯
            position:
              - 0
              - 0
              - 0
          - light: switch.babai_202m_36a0_right_switch_service
            model: Sphere_104_701
            class: cRight
            style: ''
            color: '#D485FF'
            intensity: 10
            distance: 4
            decay: 2.8
            name: 二楼过道灯
            position:
              - 0
              - 0
              - 0
          - light: switch.babai_203m_66f2_middle_switch_service
            model: Sphere_104_685
            class: cRight
            style: bedA
            color: '#FFEE99'
            intensity: 10
            distance: 4
            decay: 2.8
            name: 楼梯灯
            position:
              - 0
              - 0
              - 0
          - light: light.leishi_eps127_fb44_light
            model: Sphere_104_705
            class: cLeft
            style: bedB
            color: '#ffa66b'
            intensity: 10
            distance: 4
            decay: 2.8
            name: 书房灯
            position:
              - 0
              - 0
              - 0
          - light: light.leishi_eps127_8ac3_light
            model: Sphere_104_709
            class: cRight
            style: ''
            color: '#D485FF'
            intensity: 10
            distance: 4
            decay: 2.8
            name: 二楼主卧灯
            position:
              - 0
              - 0
              - 0
夸克网盘分享




TVT预览.png
回复

使用道具 举报

2

主题

53

回帖

377

积分

论坛技术达人

积分
377
金钱
317
HASS币
20
QQ
 楼主| 发表于 2025-3-16 16:34:14 | 显示全部楼层
kkzxsews 发表于 2025-3-16 16:29
我也感觉这块没什么市场 我个人玩HA的乐趣就在于自己瞎折腾 付费的话等于是直接跳过折腾快进到索然无味 那 ...

呐 这不这么多高手玩起来了哈
接个微信小程序,跑起来 体验感是拉满的
该有的都会有的
回复

使用道具 举报

7

主题

147

回帖

948

积分

高级会员

积分
948
金钱
794
HASS币
0
发表于 2025-3-16 17:08:58 | 显示全部楼层
kkzxsews 发表于 2025-3-16 16:29
我也感觉这块没什么市场 我个人玩HA的乐趣就在于自己瞎折腾 付费的话等于是直接跳过折腾快进到索然无味 那 ...

麻烦问一下,这个3D户型如果想更改,需要用什么软件呢?比如要用three吗?有没有酷家乐或者sweet这类的简单小白易学的
回复

使用道具 举报

2

主题

25

回帖

549

积分

高级会员

积分
549
金钱
522
HASS币
0
发表于 2025-3-16 17:27:16 | 显示全部楼层
yx262514 发表于 2025-3-16 17:08
麻烦问一下,这个3D户型如果想更改,需要用什么软件呢?比如要用three吗?有没有酷家乐或者sweet这类的简 ...

我的模型就是用SweetHome3D做的 然后导出为OBJ格式 然后找个在线转化格式的网页把OBJ转为GLTF   three的作用是把GLTF模型加载到网页中  GLTF转化完成后放到插件所在的目录下 然后配置仪表盘的yaml 告诉插件你把模型放在哪个位置让它把模型加载进去 然后修改 position(位置) scale(缩放) 让模型移动到你想要的位置
回复

使用道具 举报

59

主题

626

回帖

4541

积分

论坛元老

积分
4541
金钱
3851
HASS币
20
发表于 2025-3-17 01:57:33 | 显示全部楼层
刚刚试试手机16pm 测试一会手机发热不是很流畅
是不是有个预渲染的办法 可以优化流畅度呢
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2025-5-1 09:25 , Processed in 0.986341 second(s), 27 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表