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

 找回密码
 立即注册
楼主: Mr.G

[进阶教程] 根据论坛dscao大佬和风天气插件写的NR推送播报天气,11.16更新

  [复制链接]

0

主题

20

帖子

178

积分

注册会员

Rank: 2

积分
178
金钱
158
HASS币
0
发表于 2023-11-28 11:27:07 | 显示全部楼层
学习大佬
回复

使用道具 举报

5

主题

64

帖子

290

积分

中级会员

Rank: 3Rank: 3

积分
290
金钱
226
HASS币
0
发表于 2023-11-28 22:29:53 来自手机 | 显示全部楼层
看下咋整
回复

使用道具 举报

0

主题

18

帖子

145

积分

注册会员

Rank: 2

积分
145
金钱
127
HASS币
0
发表于 2023-11-28 23:07:00 来自手机 | 显示全部楼层
谢谢分享
回复

使用道具 举报

0

主题

18

帖子

99

积分

注册会员

Rank: 2

积分
99
金钱
81
HASS币
0
发表于 2023-11-29 08:41:41 | 显示全部楼层
感谢分享
回复

使用道具 举报

5

主题

64

帖子

290

积分

中级会员

Rank: 3Rank: 3

积分
290
金钱
226
HASS币
0
发表于 2023-11-29 10:33:21 | 显示全部楼层
第二步代码加进去重启就出错,是什么原因:

重载配置失败
Cannot quick reload all YAML configurations because the configuration is not valid: Error loading /config/configuration.yaml: 'utf-8' codec can't decode byte 0xcc in position 42: invalid continuation byte
回复

使用道具 举报

5

主题

64

帖子

290

积分

中级会员

Rank: 3Rank: 3

积分
290
金钱
226
HASS币
0
发表于 2023-11-29 10:36:49 | 显示全部楼层
# Loads default set of integrations. Do not remove.
default_config:

tts:
  - platform: google_translate

homeassistant:
  packages: !include_dir_named packages/
#  allowlist_external_dirs:
#    - /config

#group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor: !include sensor.yaml

# Load frontend themes from the themes folder
frontend:
#  extra_module_url:
#    - /hacsfiles/lovelace-card-mod/card-mod.js
  themes: !include_dir_merge_named themes

#template: !include sidebar.yaml

#browser_mod:

#lovelace:
#  mode: storage
#  dashboards:
#    mattias-lovelace:
#      mode: yaml
#      title: Mattias
#      icon: mdi:tablet-cellphone
#      show_in_sidebar: true
#      filename: dashboards/tablet/ui-lovelace.yaml
remote:
  - platform: xgimi
    name: H3S
    host: 192.168.1.115
    token: "22D7C7899B9F80FFFFFF0000024B540D"
template:
  - sensor:
      - name: 一小时天气预警
        state: '{% if ("雨" in states.weather.tian_qi.attributes.hourly_forecast[0].text) %}{{states.weather.tian_qi.attributes.hourly_forecast[0].datetime}}降雨概率为:{{states.weather.tian_qi.attributes.hourly_forecast[0].probable_precipitation}}%,可能{{states.weather.tian_qi.attributes.hourly_forecast[0].text}},请多加注意!{% else %}未来一小时无不良天气{% endif %}'
      - name: 自然灾害预警最新一条
        state: '{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].pubTime}}{% else %}当前无自然灾害预警信息{% endif %}'
        attributes:
          title: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].title}} {% else %}null{% endif %}"
          text: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].text }} {% else %}null{% endif %}"
          pubTime: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].pubTime}} {% else %}null{% endif %}"
          startTime: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].startTime}} {% else %}null{% endif %}"
          endTime: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].endTime}} {% else %}null{% endif %}"
          sender: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].sender}} {% else %}null{% endif %}"
          severity: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].severity}} {% else %}null{% endif %}"
          severityColor: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].severityColor}} {% else %}null{% endif %}"
          level: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].level}} {% else %}null{% endif %}"
          typeName: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].typeName}} {% else %}null{% endif %}"
          all: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning}} {% else %}null{% endif %}"
回复

使用道具 举报

22

主题

464

帖子

5248

积分

元老级技术达人

略懂一些皮毛而已!

积分
5248
金钱
4774
HASS币
40
 楼主| 发表于 2023-11-29 19:13:19 | 显示全部楼层

编码问题,最基本的问题啊,  把编码改为utf-8就可以了。
回复

使用道具 举报

5

主题

64

帖子

290

积分

中级会员

Rank: 3Rank: 3

积分
290
金钱
226
HASS币
0
发表于 2023-11-30 12:45:48 | 显示全部楼层
郭子漳 发表于 2023-11-29 19:13
编码问题,最基本的问题啊,  把编码改为utf-8就可以了。

感谢大佬,确实编码问题!
再请教下,家里没有小爱,只有homepod, 可以播报吗
回复

使用道具 举报

5

主题

64

帖子

290

积分

中级会员

Rank: 3Rank: 3

积分
290
金钱
226
HASS币
0
发表于 2023-12-1 15:14:05 | 显示全部楼层
2023年11月16日更新:
由于nodered16.0.x版本往后把配置目录改为addon_configs/xxxxxxxx_nodered(xxxxxxxx每个人不一样),所以,如果升级nodered16.0.x以后版本的朋友,把tsbtjl.txt文件移动到addon_configs/xxxxxxxx_nodered这个目录下,然后其余不需要操作,就可以正常使用该流程,如果是16.0.x以前的朋友,还是按照教程来,无需任何操作!



如果是群晖docker的nr,这个文件要放哪里呢,路径怎么写
回复

使用道具 举报

0

主题

18

帖子

208

积分

中级会员

Rank: 3Rank: 3

积分
208
金钱
190
HASS币
0
发表于 2023-12-1 19:28:46 | 显示全部楼层
感谢分享
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-29 16:55 , Processed in 0.216917 second(s), 29 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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