twrecked / hass-aarlo

Asynchronous Arlo Component for Home Assistant
GNU Lesser General Public License v3.0
370 stars 77 forks source link

Call aarlo services from Node-RED #331

Open elgeniskogen opened 3 years ago

elgeniskogen commented 3 years ago

Hi, Thank you very much for this wonderful aarlo package. Good job and highly appreciated!

I am doing my automations on Node-RED and have not been successful in calling aarlo services from Node-RED. E.g. if I use the "Call service node" with:

Server: Home Assistant Domain: home assistant Service: aarlo.alarm_set_mode Entity id: alarm_control_panel.aarlo_arlo_home Data: { "entity_id": "alarm_control_panel.aarlo_arlo_home", "mode": "Armed home" }

.... I get "Call-service API error. Error Message: Service not found"

Someones help on calling aarlo services would be highly appreciated :-)

twrecked commented 3 years ago

Can you see the services in home assistant? Go to Developer Tools (Hammer) -> SERVICES and see if the service appears in the list. Can you call alarm_set_mode manually from there?

Do you have you alarm control panel enabled for Aarlo?

elgeniskogen commented 3 years ago

Thank you @twrecked for answering. Yes, the aarlo services are all available in Home Assistant and I am able to make YAML automations with them. I also have the alarm control available for aarlo working well. But for some reason I am not able to call the services from Node-RED. There is not a separate "domain" for Carlo in Node-RED, so I used "homeassistant". Still I get the call service error that service is not found. Have you tried this in Node-RED yourself? Am I using the right parameters in the "Call Service node"? Please let me know I can provide more relevant information.

iannecj commented 3 years ago

I am able to command a snapshot to aarlo services through home assistant from nodered. Does this example help in any way? In the flow below I command aarlo service in home assistant to take a snapshot and send notification to my push notification service. I am using home assistant on rasp pi and have the supervised version so that nodered is an add on. Setting up the nodered call services node is easy in that case. However, in order to call any services from node red in home assistant that has to be setup right. To made sure I can call (any) services I initially tried just to turn and and off light with light turn on service. Make sure you can call any service then try this aaarlo automation.

Basic call service setup for light control as test:

image

image

Now using aarlo services:

image

image

image

elgeniskogen commented 3 years ago

Thank you both @iannecj and @twrecked for your efforts! After seeing your example @iannecj with "Domain=aarlo" I tried again. Suddenly aarlo popped up as a domain for me as well. I have been trying this before, but it seems like the domain list has not been updated properly from HA to Node-RED. Now it is working perfectly :-)

twrecked commented 3 years ago

@iannecj Thanks - I'm completely out of my depth with Node Red!

iannecj commented 3 years ago

@twrecked You do amazing things for me and my household with your work on this plugin. If I see the possibility to off load you to that task I'll jump at the chance. And thanks again....really....