PushOver Binding on OH 4.3.0 - message cannot be blank - body = “”

I upgraded to 4.3.0 Stable when it was released and just realized that the PushOver binding is failing when you send stuff it.

It works fine testing within the Thing configuration, but if you send stuff to it (with or without) an image it goes into an offline state and says “message cannot be blank”

I’ve tried everything to debug this below:

  1. Removed Thing definition and created a new Thing through the GUI
  2. Sending only Text
  3. Sending only Text with an Image
  4. Created a new pushover account with new tokens

I use variables in my sending with the pushover binding, use to work, maybe it doesn’t now?

var String PushOverMIME = 'image/jpeg'	
val pushOverActions = getActions("pushover","pushover:pushover-account:account")
var String subjectemailhomealarmSMS	= "House Alarm"	
var String bodyemailhomealarmSMS	= "House Alarm power is OFF. Is it raining?"				
val String attachment = "/etc/openhab/html/images/OH400x400.jpg"
val String attachmentUrlListPushOver = attachment
pushOverActions.sendAttachmentMessage(bodyemailhomealarmSMS, subjectemailhomealarmSMS, attachmentUrlListPushOver, PushOverMIME)
pushOverActions.sendMessage(bodyemailhomealarmSMS, subjectemailhomealarmSMS)

Best, Jay

I tested your code and adapted it to my system (openHAB 4.3.2), it seems to work fine, image is send, no error message:

var String PushOverMIME = 'image/jpeg'	
val pushOverActions = getActions("pushover", "pushover:pushover-account:pushover")
var String subjectemailhomealarmSMS	= "House Alarm"	
var String bodyemailhomealarmSMS	= "House Alarm power is OFF. Is it raining?"				
val String attachment = "/opt/openhab/conf/html/dahua1/ipcamera.gif"
val String attachmentUrlListPushOver = attachment
pushOverActions.sendAttachmentMessage(bodyemailhomealarmSMS, subjectemailhomealarmSMS, attachmentUrlListPushOver, PushOverMIME)
pushOverActions.sendMessage(bodyemailhomealarmSMS, subjectemailhomealarmSMS)

Edit: I had no problems in 4.3.0 either

Can you send me your screenshot of your thing configuration in the GUI?

Sure:

UID: pushover:pushover-account:pushover
label: Pushover Konto
thingTypeUID: pushover:pushover-account
configuration:
  apikey: <api-key>
  expire: 3600
  sound: default
  idleTimeout: 300
  format: none
  title: openHAB
  user: <user>
  retry: 300
  timeout: 10

Do you have duplicates below when you test within the Thing? I find this strange.

Best, Jay

Yes:

It is the first time I see the Thing actions, though :innocent:

I’ve created a new Thing and instead of copying the OLD thing ID, using a completely new one. Thats the only thing I see that is different between ours.

Pushing changes now.

Best, Jay

Still have the issue, once I send anything to pushover via a DSL script, it goes offline and says “message cannot be blank” at the Thing level status.

Within the Thing itself, I can use the Thing testing area at the bottom and send messages w/o any issues.

I’ve turned on DEBUG now to see if theres something I can see.

Best, Jay

Maybe some hidden character somewhere?
I would copy the code to an ASCII editor (Notepad++) and select “Show all characters”.

I use NotePad++ to code in. Just did that, only seeing LF at the end of each line.

DEBUG mode is on now, waiting for a rule to trigger pushover stuff. DEBUG is reporting everything from the startup process.

Best, Jay

Looks like the pushover server is sending that message back to OH and it’s taking the binding offline also.

2025-01-16 13:51:24.777 [DEBUG] [hover.internal.config.PushoverConfigOptionProvider] - bundle org.openhab.binding.pushover:4.3.0 (314)[org.openhab.binding.pushover.internal.config.PushoverConfigOptionProvider(380)] : Changed state from active to active
2025-01-16 14:11:14.009 [DEBUG] [pushover.internal.connection.PushoverAPIConnection] - Pushover server responded with status code 400: {"message":"cannot be blank","errors":["message cannot be blank"],"status":0,"request":"a95417c7-2cba-4bc9-aeb7-0e31dc997923"}
2025-01-16 14:11:14.050 [DEBUG] [pushover.internal.connection.PushoverAPIConnection] - Pushover server responded with status code 400: {"message":"cannot be blank","errors":["message cannot be blank"],"status":0,"request":"0cff64b4-7995-4e6e-98e0-274b20ef8f2a"}

Spent 3 days trying to figure this out, even used past bindings, same results with OH 4.3.0

I believe I have identified why the pushover binding goes into an error state (“message cannot be blank”) when passing this variable body = “” into the message.

var String subject = “HEAT Alarm”
var String body = “”
pushOverActions.sendMessage(body, subject)

The pushover binding is NOT handing this error coming back from pushover server properly taking the binding offline.

→ Pushover server responded with status code 400 ←

I know you can pass @Nullable into these fields instead of a variable, in my opinion the binding should handle this “” vs. taking it offline.

Best, Jay

The question is now, why did you get that error in your example where that field is not empty …

var String bodyemailhomealarmSMS	= "House Alarm power is OFF. Is it raining?"
...
pushOverActions.sendMessage(bodyemailhomealarmSMS, subjectemailhomealarmSMS)

That example works, i just grab an example of my code randomly not knowing what was causing it.

Try that same example but make the body “” and it should take the binding offline now.

Best, Jay

The docs clearly state that

The parameter message is mandatory

so I think we have to take care about that ourselves.

All good, at least now we have it documented what takes the pushover binding OFFLINE by not handling the error code coming back.

Best, Jay

1 Like