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

 找回密码
 立即注册
查看: 4509|回复: 2

[已解决] node-red与HA时区不一致

[复制链接]

18

主题

230

帖子

2422

积分

金牌会员

Rank: 6Rank: 6

积分
2422
金钱
2192
HASS币
0
发表于 2021-6-6 23:31:40 | 显示全部楼层 |阅读模式
本帖最后由 dtww1215 于 2021-6-7 07:11 编辑

请问一下 HA与node-red的时间不一致 应该怎么改呢?
HA时间是对的,但是这个NODE-RED的时间就不对
安装方式:hassos+商店下载
dad9f5037427b97f0b1f0912166af93.png


我什么都没弄,他就好了 不解


回复

使用道具 举报

76

主题

1358

帖子

1万

积分

元老级技术达人

积分
18475
金钱
17077
HASS币
290
发表于 2021-6-7 08:41:01 | 显示全部楼层
ha addon 自带文档有说明:

Time zone configuration
The addon will use the configured time zone of the underlying operating system. If this is incorrect (for example with the Home Assistant Operating System it will be UTC), this can be configured in the /config/node-red/settings.js file.

To do so, open the file with a text editor and add the following above the module.exports = { line.

process.env.TZ = "America/Toronto";

The time zone will need to reflect your environment.

Save the file and restart the Node-RED add-on.

可能某些不正确的情况下需要配置一下:
/config/node-red/settings.js 文件中增加一行:
process.env.TZ = "Asia/Shanghai";
回复

使用道具 举报

18

主题

230

帖子

2422

积分

金牌会员

Rank: 6Rank: 6

积分
2422
金钱
2192
HASS币
0
 楼主| 发表于 2021-6-7 10:05:24 | 显示全部楼层
dscao 发表于 2021-6-7 08:41
ha addon 自带文档有说明:

Time zone configuration

我昨天增加了 但是当时没有效果,然后代码有删掉了,今天早上起来看了一下,又好了
不知道是不是因为出国旅游以及主机重启,直接导致的
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-2 03:26 , Processed in 0.054710 second(s), 27 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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