From af57c744bea73e18b9ff03457f711b66d9a990f0 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sat, 21 Oct 2017 22:44:39 +0200 Subject: [PATCH] Update run_local.markdown --- source/hassio/run_local.markdown | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/hassio/run_local.markdown b/source/hassio/run_local.markdown index 549213b22c8..6dbd4781bf0 100644 --- a/source/hassio/run_local.markdown +++ b/source/hassio/run_local.markdown @@ -11,11 +11,13 @@ footer: true Hass.io is a managed environment, which means that you can't install applications that can be embedded into Home Assistant using the `command_line` sensor/switch. -There are two options if you need to run a script to read data from a sensor or send commands to other devices on Hass.io. +There are three options if you need to run a script to read data from a sensor or send commands to other devices on Hass.io. The first option is to write a custom component for Home Assistant. Using Python, you can communicate with your device. For more information about developing a custom component, take a look at the [developer documentation][custom-component]. -The second option is to make a local add-on for Hass.io that sends the data to Home Assistant via MQTT. Before we dive into this, read up on [Hass.io add-on development][addons-tutorial] first. +The second option is to use STDIN inside add-on and use the service `hassio.addon_stdin` to send data. More about this options look into [developer documentation][communication] for internal add-on communication. There is also describe how do you can easy access to Home-Assistant Rest API. + +The third option is to make a local add-on for Hass.io that sends the data to Home Assistant via MQTT. Before we dive into this, read up on [Hass.io add-on development][addons-tutorial] first. For security and speed, Hass.io does not provide a way for containers to communicate directly. So the first step is to set up a communication channel. We're going to use MQTT for this using the [MQTT broker add-on][mqtt-addon]. @@ -98,3 +100,4 @@ done < <(mosquitto_sub -h "$MQTT_SERVER" -p "$MQTT_PORT" -u "$USER" -P "$PASSWOR [MQTT-addon]: /addons/mosquitto/ [custom-component]: /developers/component_loading/ [addons-tutorial]: /developers/hassio/addon_tutorial/ +[communication]: /developers/hassio/addon_communication/