『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
楼主: relliky

[基础教程] 我彻底弃用HA模版Jinja了,因为Python更好更容易 [Pyscript插件]

  [复制链接]

6

主题

43

帖子

231

积分

中级会员

Rank: 3Rank: 3

积分
231
金钱
188
HASS币
0
发表于 2022-5-1 13:26:20 | 显示全部楼层

nodered不好用吗
回复

使用道具 举报

10

主题

1388

帖子

4427

积分

论坛元老

Rank: 8Rank: 8

积分
4427
金钱
3039
HASS币
0
发表于 2022-5-4 13:53:25 | 显示全部楼层

多谢大神,看看教程
回复

使用道具 举报

0

主题

1

帖子

35

积分

新手上路

Rank: 1

积分
35
金钱
34
HASS币
0
发表于 2022-5-4 15:14:41 | 显示全部楼层
感谢大佬分享
回复

使用道具 举报

0

主题

8

帖子

38

积分

新手上路

Rank: 1

积分
38
金钱
30
HASS币
0
发表于 2022-5-7 17:37:43 | 显示全部楼层
高手啊,学习
回复

使用道具 举报

16

主题

167

帖子

2201

积分

金牌会员

Rank: 6Rank: 6

积分
2201
金钱
2034
HASS币
0
发表于 2022-5-18 13:49:35 | 显示全部楼层
你好大佬,我把Pyscript kernel 安装在debian11的虚拟机里面,然后HAOS集成也安装了pyscript,add-on也安装了JupyterLab,但是按照你的方法配置JupyterLab,为何起不来?
回复

使用道具 举报

32

主题

1074

帖子

5006

积分

论坛元老

Rank: 8Rank: 8

积分
5006
金钱
3917
HASS币
90
 楼主| 发表于 2022-5-19 03:11:13 | 显示全部楼层
本帖最后由 relliky 于 2022-5-19 03:57 编辑
jpcugv 发表于 2022-5-18 13:49
你好大佬,我把Pyscript kernel 安装在debian11的虚拟机里面,然后HAOS集成也安装了pyscript,add-on也安装 ...

你要不看看JupyterLab addon启动的日志?
我家全屋智能的HA设置 https://github.com/relliky/Tais_Home_Assistant_Config
回复

使用道具 举报

32

主题

1074

帖子

5006

积分

论坛元老

Rank: 8Rank: 8

积分
5006
金钱
3917
HASS币
90
 楼主| 发表于 2022-5-19 04:02:42 | 显示全部楼层

你好像连我写的第一句话都没读完。。。。
我家全屋智能的HA设置 https://github.com/relliky/Tais_Home_Assistant_Config
回复

使用道具 举报

0

主题

24

帖子

109

积分

注册会员

Rank: 2

积分
109
金钱
85
HASS币
0
发表于 2022-5-19 10:56:52 | 显示全部楼层
彻底弃用HA模版Jinja了,因为Python更好更容易 [Pyscript插件] [修改]
回复

使用道具 举报

16

主题

167

帖子

2201

积分

金牌会员

Rank: 6Rank: 6

积分
2201
金钱
2034
HASS币
0
发表于 2022-5-19 11:21:51 | 显示全部楼层
relliky 发表于 2022-5-19 03:11
你要不看看JupyterLab addon启动的日志?

配置如下:
github_access_token: ghp_srHauWoOzGtqNm0vRTPxxxxxxx
init_commands:
  - pip install hass_pyscript_kernel
  - jupyter pyscript install
  - >-
    echo "[homeassistant]" >
    /usr/local/share/jupyter/kernels/pyscript/pyscript.conf
  - >-
    echo "hass_host = 192.168.100.98" >>
    /usr/local/share/jupyter/kernels/pyscript/pyscript.conf
  - >-
    echo "hass_url = http://supervisor/core/" >>
    /usr/local/share/jupyter/kernels/pyscript/pyscript.conf
  - >-
    echo "hass_token = $SUPERVISOR_TOKEN" >>
    /usr/local/share/jupyter/kernels/pyscript/pyscript.conf
system_packages: []
#########################
错误日志:
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing...
-----------------------------------------------------------
Add-on: JupyterLab
Create documents containing live code, equations, visualizations, and explanatory text
-----------------------------------------------------------
Add-on version: 0.7.0
You are running the latest version of this add-on.
System: Home Assistant OS 8.0  (amd64 / qemux86-64)
Home Assistant Core: 2022.5.2
Home Assistant Supervisor: 2022.05.2
-----------------------------------------------------------
Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] jupyter.sh: executing...
[cont-init.d] jupyter.sh: exited 0.
[cont-init.d] nginx.sh: executing...
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] notebooks.sh: executing...
hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint:
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
Already up to date.
fatal: cannot change to '/config/notebooks//bokeh-examples': No such file or directory
fatal: cannot change to '/config/notebooks/bokeh-examples': No such file or directory
[cont-init.d] notebooks.sh: exited 128.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing...
-----------------------------------------------------------
                Oops! Something went wrong.

We are so sorry, but something went terribly wrong when
starting or running this add-on.

Be sure to check the log above, line by line, for hints.
-----------------------------------------------------------
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
回复

使用道具 举报

16

主题

167

帖子

2201

积分

金牌会员

Rank: 6Rank: 6

积分
2201
金钱
2034
HASS币
0
发表于 2022-5-19 12:18:43 | 显示全部楼层
relliky 发表于 2022-5-19 03:11
你要不看看JupyterLab addon启动的日志?

大佬,我不是很明白为何配置kernels还需要在http://supervisor/core这里面?我看了一下我的这个容器,里面并没有kernels,我的kernels实在debian里面安装的并且配置了pyscript.conf了,感谢大佬答复
    echo "[homeassistant]" >
    /usr/local/share/jupyter/kernels/pyscript/pyscript.conf
  - >-
    echo "hass_host = 192.168.1.8" >>
    /usr/local/share/jupyter/kernels/pyscript/pyscript.conf
  - >-
    echo "hass_url = http://supervisor/core/" >>
    /usr/local/share/jupyter/kernels/pyscript/pyscript.conf
  - >-
    echo "hass_token = $SUPERVISOR_TOKEN" >>
    /usr/local/share/jupyter/kernels/pyscript/pyscript.conf
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-12-28 01:17 , Processed in 0.072490 second(s), 30 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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