Goodmorning!
Maybe you can maken my morning better haha! I was try to use a text from a incoming webhook post in my homey. The text is every time something else.
This is what I get from the webhook:
{
“_data”: {
“actionData”: {
“Timestamp”: “2022-05-11T12:17:53.4670000”,
“ControlID”: “b”,
“MsgInID”: “-100480081”,
“MsgOutID”: “100480081”
},
“remote”: true,
“notificationId”: “1766FC90-B82E-42FE-97FD-960373499FE5”,
“priority”: “10”
},
“_remoteNotificationCompleteCallbackCalled”: false,
“_isRemote”: true,
“_notificationId”: “1766FC90-B82E-42FE-97FD-960373499FE5”,
“_alert”: “ **TEST BR P1 teststraat 1 ** ”,
“_sound”: “pager.caf”,
“_category”: “reply”,
“_contentAvailable”: 1
}
I want to put the text after alert in a variable and use them for let Sonos speak.
This is a video how they made it in home assistant. I hope someone can help me with the webhook and json.
Thanks! Greeetz Bono
Hi Bono,
This might get you started. Read the replies on this topic:
Hello,
I have a device sending this json data: (http://192.168.180.134/data.json )
{"software_version": "NRZ-2020-133", "age":"54", "sensordatavalues":[{"value_type":"SDS_P1","value":"0.90"},{"value_type":"SDS_P2","value":"0.70"},{"value_type":"BME280_temperature","value":"22.82"},{"value_type":"BME280_pressure","value":"98221.00"},{"value_type":"BME280_humidity","value":"52.27"},{"value_type":"samples","value":"4958986"},{"value_type":"min_micro","value":"28"},{"value_type":"max_micro","value"…
The issue here is that the data gets pushed to Homey in a webhook.
With http request app Homey can listen for a POST webhook
Hint:
.
Then one could extract a value from the JSON body and save it to a BetterLogic variable.
Hint:
This looks very similar to what I am doing here: [How To] Setup two-way communication between Homey and Android smartphone
A bit more detail:
With the Tasker plugin AutoNotification it is possible to intercept any notification on your Android phone. Then you just sent the data of that notification via Tasker as a webhook to Homey.
DaanV
May 13, 2022, 4:00pm
6
The webhook from PreCom in iOs is working for me. Also the text over the Sonos speakers. I hope this is also working for you. The webhook URL in the PreCom app for me is then https://xxxxAthomCloudIdxxxx.connect.athom.com/api/app/com.internet/pager
Grt, Daan
2 Likes
DaanV
October 1, 2023, 3:53pm
9
I have now purchased a Homey Pro 2023. But the http request flow cards app no longer works. How can I send a request to my homey and convert the json objects to a tag?
Caseda
October 1, 2023, 4:06pm
10
You can use the build in Logic: “Webhook event received” card
1 Like
and you can process the JSON with one of these ‘advanced flow’ cards
There’s also 2 webhook apps you could check out
Support topic for the app Webhook Manager
After installing the app, go to the ‘Settings’ page and see the Webhook Manager settings. It shows the URL you can POST to and example code in PHP with the correct URL for your installation.
For example, in PHP using CURL:
<?php
$data = array("event" => "MyEvent", "data1" => "test1", "data2" => "test2", "data3" => "test3");
$data_string = json_encode($data);
$ch = curl_init('http…
DaanV
October 1, 2023, 7:07pm
12
Thanks for your quick response. The second app ‘Webhooks’ worked for me. In combination with logic cards I can convert the json object to a text tag.
1 Like
Did you also get this to work on the Home Pro 2023?
Hey Jeroen,
You can try to use the app PreCom from the app store;
1.0.5: PreCom App for Homey | Homey
Test version (1.1.0) : PreCom App for Homey | Homey