So i did some homework to perhaps make it easier for you. (192.168.1.115 is my doorbird) 81 hass.
GET to bha-api/schedules.cgi for getting schedules.
Remove old entry’s etc etc like:
http://192.168.1.115/bha-api/schedule.cgi?action=remove&input=doorbell¶m=1
Doing a POST with a json payload to schedule.cgi will add the entry. However, unlike the end result which is a nicely formated 3 segment json object, it will only allow you to add 1 entry at a time (at least from what i tried)
Here are the 3 entry’s you can add, including input 2 if you want that aswell.
{
"input": "doorbell",
"param": "1",
"output": [
{
"event": "http",
"param": "0",
"enabled": "1",
"schedule": {
"weekdays": [
{
"to": "82799",
"from": "82800"
}
]
}
}
]
}
{
"input": "motion",
"param": "",
"output": [
{
"event": "http",
"param": "1",
"enabled": "1",
"schedule": {
"weekdays": [
{
"to": "82799",
"from": "82800"
}
]
}
}
]
}
{
"input": "input",
"param": "1",
"output": [
{
"event": "http",
"param": "2",
"enabled": "1",
"schedule": {
"weekdays": [
{
"to": "82799",
"from": "82800"
}
]
}
}
]
}
Motion doesn’t take any params btw. So leave that empty.
GET to bha-api/favorites.cgi for the list of current favorites.
Delete the old legacy ones:
http://192.168.1.115/bha-api/favorites.cgi?action=remove&type=http&id=1000
http://192.168.1.115/bha-api/favorites.cgi?action=remove&type=http&id=1001
http://192.168.1.115/bha-api/favorites.cgi?action=remove&type=http&id=1002
Doing a GET with a save url sets them.
http://192.168.1.115/bha-api/favorites.cgi?action=save&type=http&title=http_notification_doorbell&value=http://192.168.1.81:8123/api/doorbird/doorbell
http://192.168.1.115/bha-api/favorites.cgi?action=save&type=http&title=http_notification_motionsensor&value=http://192.168.1.81:8123/api/doorbird/motionsensor
http://192.168.1.115/bha-api/favorites.cgi?action=save&type=http&title=http_notification_input&value=http://192.168.1.81:8123/api/doorbird/input
According to the docs the weekdays is “always” but the legacy’s still had this:
"to": "0",
"from": "604799"
So don’t know if that makes a difference…
But this should be the proper way as they want to have it these days as stated in the doorbird api.
Hope it helps
Ow and don’t forget that in order to save these items, you have to have that new API-Operator flag on your account (which was not default on for me) see: