Author Topic: Is there a length limit of the message?  (Read 2779 times)

Offline signal15

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +1/-0
Is there a length limit of the message?
« on: November 13, 2012, 08:05:11 pm »
I have the following code below in a scene to speak the weather.  It fires when I disarm the alarm in the morning.  It worked yesterday, but right now, it stops talking at "... with a high today<stop>".  If it said "... with a high today of" I would think it was a problem pulling the variable for the high temp.  But it stops at "today". 

I know C2DM has a limit of 1024 characters, but I don't think this message is anywhere near that.  Thoughts?

Code: [Select]
local currentTemp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1", "CurrentTemperature", 48)
local lowTemp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1", "CurrentTemperature", 49)
local highTemp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1", "CurrentTemperature", 50)
local currentCondition = luup.variable_get("urn:upnp-micasaverde-com:serviceId:Weather1", "Condition", 47)
local currentWind = luup.variable_get("urn:upnp-micasaverde-com:serviceId:Weather1", "WindCondition", 47)

local speakMessage = "{tone:1} Good Morning.  Current conditions are " .. currentCondition .. " with wind " .. currentWind .. ".  The temperature is " .. currentTemp .. " degrees with a high today of " .. highTemp .. " and a low of " .. lowTemp

luup.call_action("urn:richardgreen:serviceId:VeraAlert1", "SendAlert",
                  {Message = speakMessage, Recipients = ""}, 46)

Offline signal15

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +1/-0
Re: Is there a length limit of the message?
« Reply #1 on: November 13, 2012, 08:29:23 pm »
The wind description has gotten a bit longer, and now the message stops earlier.  This must be a length issue with either C2DM or Vera Alert.  If it's with C2DM, google is encouraging devs to move over to GCM, which allows 4 times more data in a single message.  Also, providing direct socket connection to the Android device would avoid length limits with C2DM and GCM.

Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10091
  • Karma: +764/-142
Re: Is there a length limit of the message?
« Reply #2 on: November 15, 2012, 08:15:01 am »
I kept adding things to string in the "immediate send" from the Vera Device control tab.  The message was pretty long ... What size are you trying to send ?

Offline signal15

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +1/-0
Re: Is there a length limit of the message?
« Reply #3 on: November 16, 2012, 02:40:10 am »
I kept adding things to string in the "immediate send" from the Vera Device control tab.  The message was pretty long ... What size are you trying to send ?


That's the weird thing.  I can put pretty long messages into the Send field under the Vera Alerts object and they work fine.  But the weather thing I made was flaking out as I noted above, and it certainly wasn't longer than some of the tests I sent via the Send button.

Create a scene with the code above and run it.  It seems like when the wind data is long, that's when it has problems.