Cleaned up documentation (#2704)

This commit is contained in:
Alok Saboo 2017-05-24 12:27:55 -04:00 committed by Pascal Vizeli
parent 2d66598dc4
commit 9772c3f694

View File

@ -1,7 +1,7 @@
---
layout: page
title: "Run local things"
description: "Instructions on how-to run local script for HomeAssistant."
title: "Run local script"
description: "Instructions on how-to run local script for Home Assistant."
date: 2017-04-30 13:28
sidebar: true
comments: false
@ -9,17 +9,15 @@ sharing: true
footer: true
---
On a normal installation you have access to base machine and can install or add every things of script they you can call with a `command_line` sensor/switch. Since Hass.IO use docker and every application is strict limited to other, you can not use this old way to perform local stuff. For first view it look very limited but if you look better to that conecpt you will see that make all very stable and a wrong thing can not break your system. It will also warrenty that your system is in every time clear to eatch running thing.
On a normal Home Assistant installation you have access to the base machine and can install or add scripts that you can call with a `command_line` sensor/switch. Since Hass.IO uses Docker, you can not use this old way to perform local stuff. On its face, it looks quite restrictive, but it makes the whole system stable.
If you need run a script to read data for a sensor or send commands to other device, you can do that with a add-on or on inside HomeAssistant container with a custom component. We look now how we can to do that in a modern way inside a add-on. For custom component you can look into [devoloper site][custom-component].
However, if you need to run a script to read data for a sensor or send commands to other devices on Hass.IO, you can do that with a add-on or on inside the Home Assistant container with a custom component. Here is one way to accomplish that using an add-on. For custom component, look at the [devoloper site][custom-component] and also read the [add-ons tutorial][addons-tutorial]. Now you can get started with your custom component in the right way.
Before you read more on that page, please read the [add-ons turtorial][addons-turtorial]. Now you can resize your horizen to make things in a safe way.
First you need install a MQTT broker. You can use our [mqtt broker add-on][mqtt-addon]. Make sure you use logins and disable anonymos access if you want control sensible systems. We provide no Hass.IO way to exchange data, that will be not realy good for security and is also to slow to exchange data between containers or stop and go stuff. That is the reason why we use a mqtt broker for it.
First you need install a MQTT broker. You can use our [MQTT broker add-on][mqtt-addon]. Make sure you use logins and disable anonymous access if you want to secure the system. We provide no Hass.IO way to exchange data, that will be not realy good for security and is also to slow to exchange data between containers or stop and go stuff. That is the reason why we use a mqtt broker for it.
### {% linkable_title Sensors %}
Short story of that caption: We loop in our script to fetch data and push it to mqtt and wait until next processing is ready. Here is a basic example and struct for that process.
Short story of that caption: We loop in our script to fetch data and push it to MQTT and wait until next process is ready. Here is a basic example and structure for that process.
Our Dockerfile need to install:
@ -58,7 +56,7 @@ done
```
### {% linkable_title Commands %}
Short story of that caption: We wait on incoming data from mqtt broker to do some things. We can also use on HomeAssistant input_boolean that trigger a automation to publish a custom command to mqtt topic they can process multible things in one add-on.
Short story of that caption: We wait for incoming data from MQTT broker. We can also use an `input_boolean` that triggers an automation to publish a custom command to MQTT topic that can process multiple things in one add-on.
Our Dockerfile need to install:
@ -94,7 +92,6 @@ done < <(mosquitto_sub -h "$MQTT_SERVER" -p "$MQTT_PORT" -u "$USER" -P "$PASSWOR
```
[mqtt-addon]: /addons/mosquitto/
[MQTT-addon]: /addons/mosquitto/
[custom-component]: /developers/component_loading/
[addons-turtorial]: /hassio/addon_tutorial/
[addons-tutorial]: /hassio/addon_tutorial/