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

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

[流程系列] 求助,NodeRED老是报错

[复制链接]

4

主题

13

帖子

84

积分

注册会员

Rank: 2

积分
84
金钱
71
HASS币
0
发表于 2023-9-23 15:56:16 | 显示全部楼层 |阅读模式
本帖最后由 rickyshen 于 2023-9-23 15:59 编辑

我家调光玻璃亮度值要注入60%-100%范围才有变化,60%以下肉眼不可见,所以就用Function转化一下数值再输出给KNX调光模块,目前虽然已经实现了我想要的功能,但调试窗口老是报错,感觉是语法不对,特请教大家我应该改哪里啊?

截屏2023-09-23 15.53.57.png
截屏2023-09-23 15.54.05.png
截屏2023-09-23 15.54.15.png
报错:
截屏2023-09-23 12.16.16.png



[{"id":"44cc64a8f6a918ad","type":"server-state-changed","z":"76bc1932a4eb7370","name":"左窗透明度","server":"1b7ace1.5629a32","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"light.liftwindow_2","entityidfiltertype":"exact","outputinitially":false,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"data.attributes.brightness","propertyType":"msg","value":"","valueType":"eventData"}],"x":140,"y":220,"wires":[["c55832217da8baf1","4a32995d953ac4f6"]]},{"id":"c55832217da8baf1","type":"function","z":"76bc1932a4eb7370","name":"调整亮度到真实值","func":"var birg = msg.data.attributes.brightness.new_state.attributes.brightness;\nbirg = (birg * 0.41) + 150;\nvar birgint = birg.toFixed(0);\n{\n    if (birgint <= 151)\n        birgint = 1;\n    else\n        birgint = birgint;\n}\nmsg.data.attributes.brightness = birgint;\nreturn msg.data.attributes;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":370,"y":220,"wires":[["1faecc8239b72c86","0b5b5d18a2b25b81"]]},{"id":"0b5b5d18a2b25b81","type":"debug","z":"76bc1932a4eb7370","name":"debug 18","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":570,"y":140,"wires":[]},{"id":"4a32995d953ac4f6","type":"debug","z":"76bc1932a4eb7370","name":"debug 21","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":310,"y":120,"wires":[]},{"id":"1faecc8239b72c86","type":"api-call-service","z":"76bc1932a4eb7370","name":"主窗输出","server":"1b7ace1.5629a32","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.outliftwindowtransparency"],"data":"{ "brightness":brightness }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":620,"y":220,"wires":[["8a8ba3e2c4e89165"]]},{"id":"8a8ba3e2c4e89165","type":"debug","z":"76bc1932a4eb7370","name":"debug 22","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":890,"y":120,"wires":[]},{"id":"1b7ace1.5629a32","type":"server","name":"Home Assistant","addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI3ZDM3NzYwODQyNTA0MzAwODBhYjU3MzYwNWRkMDhiOCIsImlhdCI6MTY5NDYxNzI3NywiZXhwIjoyMDA5OTc3Mjc3fQ.lKAjooB5SvuEVb0hQVRjEDvYT37RgYeVpqqdt77MyXk","connectionDelay":false,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"","areaSelector":"id","deviceSelector":"id","entitySelector":"id","statusSeparator":"","enableGlobalContextStore":false}]




回复

使用道具 举报

4

主题

13

帖子

84

积分

注册会员

Rank: 2

积分
84
金钱
71
HASS币
0
 楼主| 发表于 2023-9-24 01:01:16 | 显示全部楼层
本帖最后由 rickyshen 于 2023-9-24 01:02 编辑

哦,原因找到了:homeassistant组件节点运行的Red版本是3.10。就是这恼人的提示挡着我看调试信息,有点烦。
https://community.home-assistant.io/t/node-red-4-0-warnings-have-taken-over-my-debug-window/615166/5
回复

使用道具 举报

1

主题

211

帖子

2291

积分

金牌会员

Rank: 6Rank: 6

积分
2291
金钱
2080
HASS币
0
发表于 2023-10-9 16:28:03 | 显示全部楼层
现在可以升级一下homeassistant节点了。
请教一下,我是在PVE中LXC方式安装的NODE-RED,磁盘空间空间没几天就会被占满,有什么办法进行清理无用的数据吗?
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-22 09:46 , Processed in 0.378499 second(s), 28 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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