Any ideas?
My working example:
sendPushoverMessage(pushoverBuilder("Doorbell").withApiKey("removed").withUser("removed").withAttachment("/mnt/rpi0wpicam/lastsnap.jpg"))
Hi sihui
which binding are you using ? I assume given you’re using the key/user in your command, that you do not need to make use of the pushover.cfg file
Thanks
The Pushover binding, this whole thread is about that binding
Theres a few, theres a jar floating around, theres the 2.4, theres the 2.5
Which version? I have the exact same command and it doesnt work.
I get this:
21:05:02.379 [WARN ] [hab.action.pushover.internal.Pushover] - Method failed: HTTP/1.1 400 Bad Request.
2.5 snapshot #1549
OK, im using this one:
266 │ Active │ 80 │ 1.12.0.201805280013 │ openHAB Pushover Action
07:16:23.556 [WARN ] [hab.action.pushover.internal.Pushover] - Method failed: HTTP/1.1 400 Bad Request.
Ive defined the key/user correctly as variables at the top of the rule and then use this:
sendPushoverMessage(pushoverBuilder("test message").withApiKey("PushOverAPIKey").withUser("PushOverUserKey").withAttachment("/etc/openhab2/html/latest-visitor.jpg"))
I’m not sure it that old binding version already supports images.
Where can I get the latest? I grabbed this one which I thought was the latest from the pushover thread. I didnt see anything on the jenkins site
I just installed it through PaperUI … the version depends on the core version you are using, but as far as I remember image support was already available in 2.4 release version.
Tried that one too, same issue. I’m on 2.4
07:49:14.002 [WARN ] [hab.action.pushover.internal.Pushover] - Method failed: HTTP/1.1 400 Bad Request.
If i take the var’s out from the top of the rule and place them into the command, I get a test mesage but no attachment.
Openhab user has rights to the image.
kris@openhab2:/etc/openhab2/rules$ ls -la /etc/openhab2/html/latest-visitor.jpg
-rw-r--r-- 1 openhab openhab 34272 Mar 28 07:51 /etc/openhab2/html/latest-visitor.jpg
kris@openhab2:/etc/openhab2/rules$
Looks like it can’t find the image, make sure it exists and you don’t have a syntax error.
Also for finding errors don’t use vars, type your access credentials directly into the pushoverBuilder command.
Okay, you edited your post while I was typing
Last idea: rename the image to have a name without a dash.
YAY! That did it nice work sihui
You should file a github issue because you’ve found a bug.
Yep, theres also another bug - you cant specify the Keys as variables and reference them in the send command. It errors, you can only use the keys inside the command itself.
Is there a way to stop the word openHAB coming up in each notification
You can use the withTitle
paramater
my complete rule
import java.util.List
rule "Frontdoor bell"
when
Channel "mihome:sensor_switch_aq2:wireless_switch_aqara:button" triggered
then
sendCommand(Xiaomi_Gateway_SoundVolume, 13)
sendCommand(Xiaomi_Gateway_Sound, 10012)
var FrontDoorCam = "FrontDoor.jpg"
var Location = "/tmp/"
var Title = "Ding Dong"
var Doorbellmessage = "Someone is at the door "+ now.toString ("yyyy-MM-dd HH:mm")
var ImgFile = LocationSS + FrontDoorCam
executeCommandLine("wget http://rtsp:user@192.168.x.x:80/Streaming/Channels/1/picture -O " + Location + FrontDoorCam)
val List<String> attachmentUrlList = newArrayList(
"file://" + Location + FrontDoorCam)
createTimer(now.plusSeconds(1), [ |
sendPushoverMessage(pushoverBuilder(Doorbellmessage).withTitle(Title).withPriority(0).withSound("spacealarm").withAttachment(ImgFile))
sendMail("name@email.com", Title, Doorbellmessage, attachmentUrlList)
sendCommand(Xiaomi_Gateway_Sound, 10000)
sendCommand(Xiaomi_Gateway_SoundVolume, 0)
])
end