Guide/tutorial for setting up the sending of data to a Rest API

Hello, Home Assistant Newbie here.

I’ve set up a number of Fibaro Z Wave sensors in Home Assistant (running on a Raspberry Pi 3 Model B) and I would like to send data from the sensors to Rest API whenever there is motion/activity on the sensors (I’d like to send light levels and temperature too, but all things in time). I have a URL set up to receive the data.

My question is - is there a tutorial which explains step-by-step how to configure the sending on multiple sensors to a remote URL. I see from the documentation that changes are required to the configuration.yaml, do all the changes go in there? Or does this need to be combined with automation some how.

Apologies if this is a obvious questions (or if there is a document on the site I have missed), but any help would be appreciated.

Regards,

Matthew

Automations are how you get Home Assistant to do anything based on something happening.

You could do it with a single automation, listing all the relevant entities in the trigger, and a template in the actions.

Something like this, assuming you’ve defined the REST command already, and it takes entity and value:

alias: "Send it all"
trigger:
  - platform: state
    entity_id: 
      - sensor.one
      - sensor.two
      - sensor.three
condition:
  - condition: template
    value_template: >-
      {{ trigger.from_state.state != trigger.to_state.state }}
action:
  - service: rest_command.whatever_you_called_it
    data_template:
      entity: "{{ trigger.to_state.entity_id }}"
      value: "{{ trigger.to_state.state }}"

Thanks for the help, I’ll try and spend some time on this asap and report back as to how I get on!