steps39 / Domoticz_Smappee

A Lua program to link Smappee into Domoticz
3 stars 0 forks source link

LUA error --> unclosed string at char 8103 of: #1

Closed hdoucet closed 7 years ago

hdoucet commented 7 years ago

Hello, When i run the lua program i get following error. Please advice. Log's are attached.

smappee.log.pdf smappee.log.errors.pdf

lua: /usr/local/share/lua/5.2/JSON.lua:676: /usr/local/share/lua/5.2/JSON.lua:383: unclosed string at char 8103 of:

... "timestamp": 1491432600000, "consumption": 24.0, "solar": 0.0, "alwaysOn": 145.0 }, { "times stack traceback: [C]: in function 'assert' /usr/local/share/lua/5.2/JSON.lua:676: in function 'decode' /home/wiske/domoticz_smappee/smappee.lua:319: in main chunk [C]: in ?

steps39 commented 7 years ago

Basically, too much data is being sucked in from Smappee, so you need to limit the data being requested, the error is discussed here - http://www.domoticz.com/forum/viewtopic.php?f=31&t=7312&p=52414&hilit=smappee#p52272 - where the same error is reported and solved. I first suggested to set SmappeeTimeStamp to 1 in Domoticz, which should fix the error, as it will effectively reset the system, but it doesn't always seem to work.

So reliable solution seems to be to set SmappeeTimeStamp to the current timestamp from your current smappee.log, then it should behave itself, so look at your current log and pick this value: 2017-04-22 08:50:14 - Current Time Stamp: 1492847414

One last thing to check is that your SmappeeTimeStamp variable is of type String not integer.

Let me know if this works.

hdoucet commented 7 years ago

I fixed 2 items

  1. changed SmappeeTimeStamp to String
  2. Adjusted CurrentTimeStamp just under the time stamp of my logtime stamp.

Got it work. To work. Thank you for the support.