Migrating to Home Assistant

I recently installed home assistant - setup works like a charm! Now I want to integrate the little thingies I buildt on my own based on raspi zeros and esp8266 with own software over the years. I came across the API and successfully sent REST requests with the 10 year token, this is easy so far.

Now I am stuck: How do I create virtual entities in home assistant that I can set values through the api? How can I send Jpeg Images to Home assistant from other systems (e.g. my self buildt doorlock/bell/camera with camera based on a raspi zero w)? I think I am missing one essential concept or information and would be grateful if someone could give me a tip. Thanks in advance!

Hello, I think you could start from here:

without knowing which devices you need to integrate or exactly how your devices communicate aside from generic REST API then you should start at the integrations page and do a search on “rest”

https://www.home-assistant.io/integrations/#search/rest

Thanks, I browsed that but they seem to poll endpoints. I would like to go the other way around and access HA from the device and deliver information through the REST interface of Home Assistant. Or do I oversee something?

Thanks, This I also browsed but did not find what I am searching for. I want to access my HA with a REST request https://xxx.yyy.zzz.sss:8123/api/… I found how to do that with a JSON request but I am missing the part inside Home Assistant how to create the endpoint that I can access that way.

I think the easiest way is by MQTT

Thanks. I am used to http REST apis so I would like to use that protocol. The problem is not the protocol, its WHAT DO I HAVE TO DO IN HA TO CREATE AN ENTITY that I can access from outside.

I just discovered PUSH and could soucessfully send an Image through HTTP but where is that image going? I am really confused,

I was able to integrate my ip cameras through config.yaml. There must be something lile that for creating an entity I can access via rest from outside…

Create entities using YAML file and attach their statuses and actions to input helpers and scripts

One example, you have a room temperature sensor and you are measuring with pi and you would like to send this value to HA. Create one input helper and using YAML FILE, create a template sensor and set the value of input helper using rest calls.

I have a garage door cover, which is made up with one switch and one proximity sensor. If sensor is closed, garage door shown as closed. If i click on garage door to close or open, it calls switch’s open and close actions.

cover:
  - platform: template
    covers:
      garage_door:
        device_class: garage
        friendly_name: "Garage Door"
        value_template: "{{ states.switch.garage_door.attributes.current_consumption | float * 10 > 0 }}"
        open_cover:
          service: script.garage_door_open
        close_cover:
          service: script.garage_door_close
1 Like

Thanks and sorry for responding this late - unfortunately I cannot spend the amount of time on this topic I would like to :wink:

I think this answer should help, I have a lot of sensors that currently send messages directly to telegram -so its much less effort to make them notify HA instead of enabling them to be polled by HA.