ottopaulsen / node-red-contrib-power-saver

A Node-RED node to saver money by turning off when the power is most expensive
Other
71 stars 17 forks source link

No state specified #206

Closed pittbull closed 6 days ago

pittbull commented 3 weeks ago

I am getting these error messages between midnight and 02 every morning.

Any input as to why and where to look for issues?

22 Aug 00:00:03 - [error] [ha-api:Set entity] HomeAssistantError: No state specified. 22 Aug 00:00:03 - [error] [ha-api:Set entity] HomeAssistantError: No state specified. 22 Aug 00:00:05 - [error] [ha-api:Set entity] HomeAssistantError: No state specified. 22 Aug 00:00:05 - [error] [ha-api:Set entity] HomeAssistantError: No state specified. 22 Aug 00:00:06 - [error] [ha-api:Set entity] HomeAssistantError: No state specified. 22 Aug 00:00:06 - [error] [ha-api:Set entity] HomeAssistantError: No state specified. <..> 22 Aug 01:59:49 - [error] [ha-api:Set entity] HomeAssistantError: No state specified. 22 Aug 01:59:54 - [error] [ha-api:Set entity] HomeAssistantError: No state specified. 22 Aug 01:59:55 - [error] [ha-api:Set entity] HomeAssistantError: No state specified. 22 Aug 01:59:56 - [error] [ha-api:Set entity] HomeAssistantError: No state specified. 22 Aug 01:59:59 - [error] [ha-api:Set entity] HomeAssistantError: No state specified.

ottopaulsen commented 1 week ago

Try to log the input to the Set entity node. Probably one of the values are undefined or something like that.

pittbull commented 6 days ago

You were correct, one of the values were undefined:

In "calculate nodes" I changed line 89 from:

if (isNull(highestToday)) {

to

if (isNull(highestToday.from)) {

highestToday is defined, but the .from variable was indeed nul