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

 找回密码
 立即注册
查看: 5117|回复: 6

[已解决] 没有传感器的历史记录,怎么解决[已解决]

[复制链接]

9

主题

95

帖子

470

积分

中级会员

Rank: 3Rank: 3

积分
470
金钱
375
HASS币
0
发表于 2018-6-13 13:13:04 | 显示全部楼层 |阅读模式
本帖最后由 sert12 于 2018-6-13 19:20 编辑

QQ图片20180613131035.png


查看homeassistant的历史记录提示:

Error handling request
下午12:46 components/recorder/util.py (ERROR)

Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'SELECT states.state_id AS states_state_id, states.domain AS states_domain, states.entity_id AS states_entity_id, states.state AS states_state, states.attributes AS states_attributes, states.event_id AS states_event_id, states.last_changed AS states_last_changed, states.last_updated AS states_last_updated, states.created AS states_created \nFROM states \nWHERE (states.domain IN (?, ?) OR states.last_changed = states.last_updated) AND states.last_updated > ? AND states.entity_id IN (?) AND states.last_updated < ? ORDER BY states.last_updated'] [parameters: ('thermostat', 'climate', '2018-06-12 04:46:21.195000', 'sensor.humidity_158d000239acc0', '2018-06-13 04:46:21.195000')] (Background on this error at: http://sqlalche.me/e/4xp6)
下午12:46 components/recorder/util.py (ERROR)


Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'SELECT states.state_id AS states_state_id, states.domain AS states_domain, states.entity_id AS states_entity_id, states.state AS states_state, states.attributes AS states_attributes, states.event_id AS states_event_id, states.last_changed AS states_last_changed, states.last_updated AS states_last_updated, states.created AS states_created \nFROM states \nWHERE (states.domain IN (?, ?) OR states.last_changed = states.last_updated) AND states.last_updated > ? AND states.entity_id IN (?) AND states.last_updated < ? ORDER BY states.last_updated'] [parameters: ('thermostat', 'climate', '2018-06-12 04:46:21.195000', 'sensor.humidity_158d000239acc0', '2018-06-13 04:46:21.195000')] (Background on this error at: http://sqlalche.me/e/4xp6)
下午12:46 components/recorder/util.py (ERROR)

Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'SELECT states.state_id AS states_state_id, states.domain AS states_domain, states.entity_id AS states_entity_id, states.state AS states_state, states.attributes AS states_attributes, states.event_id AS states_event_id, states.last_changed AS states_last_changed, states.last_updated AS states_last_updated, states.created AS states_created \nFROM states \nWHERE (states.domain IN (?, ?) OR states.last_changed = states.last_updated) AND states.last_updated > ? AND states.entity_id IN (?) AND states.last_updated < ? ORDER BY states.last_updated'] [parameters: ('thermostat', 'climate', '2018-06-12 04:46:21.195000', 'sensor.humidity_158d000239acc0', '2018-06-13 04:46:21.195000')] (Background on this error at: http://sqlalche.me/e/4xp6)
下午12:46 components/recorder/util.py (ERROR)


Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'SELECT states.state_id AS states_state_id, states.domain AS states_domain, states.entity_id AS states_entity_id, states.state AS states_state, states.attributes AS states_attributes, states.event_id AS states_event_id, states.last_changed AS states_last_changed, states.last_updated AS states_last_updated, states.created AS states_created \nFROM states \nWHERE (states.domain IN (?, ?) OR states.last_changed = states.last_updated) AND states.last_updated > ? AND states.entity_id IN (?) AND states.last_updated < ? ORDER BY states.last_updated'] [parameters: ('thermostat', 'climate', '2018-06-12 04:46:21.195000', 'sensor.humidity_158d000239acc0', '2018-06-13 04:46:21.195000')] (Background on this error at: http://sqlalche.me/e/4xp6)
下午12:46 components/recorder/util.py (ERROR)


回复

使用道具 举报

26

主题

553

帖子

2728

积分

金牌会员

Rank: 6Rank: 6

积分
2728
金钱
2150
HASS币
100

教程狂人

发表于 2018-6-13 17:29:57 | 显示全部楼层
不懂,原因不会分析,但是对策应该是要么修复旧数据库要么导入新数据库
回复

使用道具 举报

9

主题

95

帖子

470

积分

中级会员

Rank: 3Rank: 3

积分
470
金钱
375
HASS币
0
 楼主| 发表于 2018-6-13 18:30:29 | 显示全部楼层
Mirukuteii 发表于 2018-6-13 17:29
不懂,原因不会分析,但是对策应该是要么修复旧数据库要么导入新数据库

数据库在哪里,要怎么修复
回复

使用道具 举报

123

主题

4665

帖子

1万

积分

管理员

囧死

Rank: 9Rank: 9Rank: 9

积分
16452
金钱
11702
HASS币
45
发表于 2018-6-13 18:46:37 | 显示全部楼层
停止hass运行,删除home-assistant_v2.db,重新启动hass。
回复

使用道具 举报

9

主题

95

帖子

470

积分

中级会员

Rank: 3Rank: 3

积分
470
金钱
375
HASS币
0
 楼主| 发表于 2018-6-13 19:13:30 | 显示全部楼层
本帖最后由 sert12 于 2018-6-13 19:45 编辑
Jones 发表于 2018-6-13 18:46
停止hass运行,删除home-assistant_v2.db,重新启动hass。

谢谢,解决问题。文件位置:/usr/share/hassio/homeassistant/home-assistant_v2.db
回复

使用道具 举报

18

主题

192

帖子

1049

积分

金牌会员

Rank: 6Rank: 6

积分
1049
金钱
852
HASS币
20
发表于 2018-6-20 17:10:37 | 显示全部楼层
Jones 发表于 2018-6-13 18:46
停止hass运行,删除home-assistant_v2.db,重新启动hass。

谢谢~字数补丁
回复

使用道具 举报

7

主题

86

帖子

619

积分

高级会员

Rank: 4

积分
619
金钱
533
HASS币
0
发表于 2018-10-9 19:48:20 | 显示全部楼层
我在 /usr/share/ 下没有 /hassio/homeassistant/home-assistant_v2.db  
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-12-25 13:45 , Processed in 0.073785 second(s), 32 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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