Hey, did you ever get yours to work? Iām quite new to this HA and MQTT stuff and Iām not sure what Iām suppose to do with your config and command.
EDIT: I figured it out. I had dig through your profile to find your post. Hereās my setup if anyoneās curiousā¦
For configuration.yaml, I have something like:
binary_sensor:
- platform: mqtt
name: "Front Porch Cam" # i.e. Name of camera
state_topic: "motion/FrontPorch" # i.e. Name of topic
payload_on: "ON"
payload_off: "OFF"
device_class: "motion"
In my motionEye camera settings, I have a Run a Command like:
Then, I checked my config in Server Controls and did a server restart just for kicks. Afterward, I went back to this blueprint and created an automation like so:
Can we have something similar setup for Android phone too? The current blueprints does send the notification with snapshot for Android phone but it was silent and in the background. I know we can send HA notifications to Android with ttl:0 and priority: high settings to trigger the sound, but Iām not sure how to do it in this blueprint.
This really applies to any Home Assistant notification, but when I click on the notification, it will open Home Assistant and delete the notification (iOS).
Is there anyway to change this behavior so that I donāt loose the notification?
Do you have any other app notifications that behave like this? AFAIK, the actual behaviour you describe is controlled by iOS. What would be the point of a notification that doesnāt clear when reacted to (honestly curious)?
True, but what is the purpose of a notification which disappears before seeing the content. Curious whether there any notification type which requires you to explicitly remove the notification.
Maybe we are talking about slightly different things. Are you talking about notification banners? Those can be set as temporary or persistent (but still clears when tapped). Otherwise, it ends up in your notification centre. Regardless, one can tap and hold a notification to see it in full before just tapping it. Still, this has to do with iOS and Iām pretty sure thereās nothing HA can do about it. The only alternatives I can think of is to adjust this blueprint to also set an HA internal persistent notification, send an IM or email.
Yes, you are correct, I am talking about the notification banners and even though they can be set as temporary or persitant, as you rightfully notice, they clear when tapped.
I do understand this has to do with iOS and I assume that iOS makes the assumption, that the notification is available in Home Assistant. When you tap the notification, it opens Home Assistant, but Home Assistant just opens its current page. It might be nice if Home Assistant would open the Notification page (you could send a persitent notification at the same time), or if the notification passes anything to Home Assistant, for Home Assistant to take an action based that information.
Now I just have to find out, how to send the snapshot to two or more iPhones? Can I simple group them (like group.parentsphone) and select group.parentsphone as the device?
The only āproblemā is that I get the snapshot but when I click the notification (Android) it closes and the app is shown (not the actual snapshot). Are the snapshots saved somewhere? Would disk usage be an issue?
HA is installed on a raspberry p4 with hassio 2021.12.7
i am inexperienced with MQTT so i dont know if i am wrong something
I was following your guide to send motion alert from motioneye but not function motioneye side, this is my last command : āmosquitto_pub -h 127.0.0.1 -p 8883 -u user -P pw -t motion / gate -m ONā
I did a manual test
If I give command from MQTT
I see that the entity changes my state
maybe what i am wrong is the address i give to MQTT.
I tried to give the address:
del raspberry -h 192.x.x.x -p 1883
of the brocker -h 127.0.0.1 -p 1883
of the brocker -h 127.0.0.1 -p 8883
but it doesnāt answer me when it detects movement.
Hmmā¦ @Subia75, @TwoPuncakes I think it is a lot easier to use a webhook from MotionEye
I use this POST address: https://192.168.1.2:8123/api/webhook/doormotion from MotionEye
and then I catch it with an automation
In my config, Iām setting an input helper boolean to true for 30 secs (but only between 22:00 and 07:00):
My automation yaml:
alias: Front Doorcam motion detected
description: Notify when motion is detected between 22:00 and 07:00
trigger:
- platform: webhook
webhook_id: doormotion
condition:
- condition: time
after: '22:00'
before: '07:00'
action:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.doormotion
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
- service: input_boolean.turn_off
target:
entity_id: input_boolean.doormotion
mode: single
initial_state: true
And with the input_boolean.doormotion I make other things happenā¦, but if you only require one trigger, just use your own action
Thanks for the reply.
Iāll do this automation test to see if it responds to motion.
I need that when I have an HA movement I warn me that there is an event to watch.
But what I donāt understand is where I am wrong to give the address to me seems right.
It occurs to me that it is motioneye addon that he is unable to send messages to HA
I donāt think there is anything wrong with the used urlās.
You could test with mqtt-explorer and monitor what is going on
But I suspect youāre running Mosquito and MotionEye with HA addons (dockers)?
And that makes me doubt whether āmosquitto_pubā is available within the MotionEye docker
Maybe someone can confirm my suspicion?
Nevertheless, I think using a web-hook is easier (and skips the usage of MQTT ;))
Iām running HA Core, modified the snapshot_create_file_path so the picture is created with movement.
I do get notifications with movement, so that part is OK as well.
But, I donāt get to see the picture in the companion app (android).
I can open the snapshot in the browser on my desktop as well on mobile - restarted HA and the app.