Jarvis: Difference between revisions

From NURDspace
Line 95: Line 95:
=== Notifications ===
=== Notifications ===
==== LEDtickers ====
==== LEDtickers ====
You can use services '''notify.ledticker_zaal1''' and '''notify.ledticker_rookhok''' to send stuff to individual LEDtickers, or '''notify.all_ledtickers''' to send to all. The custom component for this can be found in ''/usr/share/hassio/homeassistant/custom_components/ledticker''. New LEDtickers can be set up in ''/usr/share/hassio/homeassistant/configuration.yaml''.
You can use services '''notify.ledticker_zaal1''', '''notify.ledticker_bar''' and '''notify.ledticker_rookhok''' to send stuff to individual LEDtickers, or '''notify.all_ledtickers''' to send to all. The custom component for this can be found in ''/usr/share/hassio/homeassistant/custom_components/ledticker''. New LEDtickers can be set up in ''/usr/share/hassio/homeassistant/configuration.yaml''.
 
Todo:
* Possibility to use host names instead of IPs


==== NURDbot ====
==== NURDbot ====

Revision as of 23:07, 23 November 2019

Jarvis
Jarvis.jpg
Participants Dennis
Skills Electronics, IoT
Status Production
Niche
Purpose Infra
Tool No
Location Coherence
Cost
Tool category

Jarvis Property "Tool Image" (as page type) with input value "File:{{{Picture}}}" contains invalid characters or is incomplete and therefore can cause unexpected results during a query or annotation process. {{{Picture}}} {{#if:No | [[Tool Owner::{{{ProjectParticipants}}} | }} {{#if:No | [[Tool Cost::{{{Cost}}} | }}

Jarvis is the VM running Home Assistant (HASS ) on Coherence and is able to automate tasks in the space

Web interface

Known issues

VM access

If you want access to the VM itself, for instance with SSH, use following creds:

  • User: nurds
  • Pass: the long one :)

Starting HASS

It starts automatically within docker

iptables port forward: iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8123

Current Automations

  • Stop music on mpd when the space is closed
  • Start music on mpd when the space opens.
  • Power down EPC/APC and Sonoff when space is closed.
  • Power up Sonoff when space is open.

Custom stuff

OpenTherm Gateway

OpenTherm gateway has been put between the heater and the thermostat, see OpenTherm_Gateway

EPC (PDU)

https://gist.github.com/zarya/52b603146faac2b3d42e417532975054

- platform: command_line
  switches:
    epc2_1:
      command_on: "/config/epc.py <IP> 1 1"
      command_off: "/config/epc.py <IP> 1 0"
      command_state: "/config/epc.py <IP> 1"
      value_template: '{{ value == "ON" }}'

http://wiki.gude.info/FAQ_EPC_CmdLine

APC (PDU)

Off snmpset -v1 -c private 10.208.30.150 .1.3.6.1.4.1.318.1.1.4.4.2.1.3.1 i 2 
On snmpset -v1 -c private 10.208.30.150 .1.3.6.1.4.1.318.1.1.4.4.2.1.3.1 i 1
get snmpget -v1 -OvqU -c public 10.208.30.150 .1.3.6.1.4.1.318.1.1.4.4.2.1.3.1
output 1 == on 2 == off
get input amps (x10) snmpget -v1 -OvqU -c NURDsnmp 10.208.30.150 .1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1

Sensor (Amps)

- platform: snmp
  name: 'pdu1_input_amps'
  host: <IP>
  community: "this"
  baseoid: .1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1
  version: "1"
  accept_errors: true
  unit_of_measurement: 'A'
  value_template: '{{ value | float / 10 }}'

Switch

- platform: snmp
  name: pdu1_1
  host: <IP>
  baseoid: .1.3.6.1.4.1.318.1.1.4.4.2.1.3.1
  community: "this"
  payload_on: 1
  payload_off: 2
  version: "1"
- platform: snmp
  name: pdu1_1
  host: <IP>
  baseoid: .1.3.6.1.4.1.318.1.1.4.4.2.1.3.2
  community: "this"
  payload_on: 1
  payload_off: 2
  version: "1"

Notifications

LEDtickers

You can use services notify.ledticker_zaal1, notify.ledticker_bar and notify.ledticker_rookhok to send stuff to individual LEDtickers, or notify.all_ledtickers to send to all. The custom component for this can be found in /usr/share/hassio/homeassistant/custom_components/ledticker. New LEDtickers can be set up in /usr/share/hassio/homeassistant/configuration.yaml.

Todo:

  • Possibility to use host names instead of IPs

NURDbot

Spams stuff using service notify.nurdbot @ Nurdbot using /usr/share/hassio/homeassistant/jsb/jsb-udpsend.

Device tracker

We get MAC addresses that are connected to the Wifi from the Aruba AP. We do not track devices by default.

Why would you want to be tracked?

We can do reporting of tracked devices and whether they are 'home' or 'not_home'. One example that we have is !who on Nurdbot. We might also do personalized automations at some point.

Enable tracking for your MAC address

If you want your device to be tracked, you need to search for your MAC address in /usr/share/hassio/homeassistant/known_devices.yaml and:

Changelog

  • Added the EPC PDU's to HASS
  • Added the space state
  • Added power usage
  • Added Axis camera
  • Added grote zaal rechts (TL)
  • Added Webcam connected to SlabPi
  • Moved to hass.io
  • Moved SonOff Basic to ESPHome and MQTT discovery
  • Added octoprint
  • Enabled device tracking through Aruba AP

Installation

We want to be able to easily update home assistant. One way to achieve this is to use Hass.io which in turn uses docker. On our proxmox environment it is not easy to run docker in a proxmox container, so we set up a proper VM for this.

Docker installation

Home assistant config location: /usr/share/hassio/homeassistant# Enabled docker repo and installed it (https://docs.docker.com/install/linux/docker-ce/ubuntu/). User nurds is in the docker group so it can do docker things without sudo.

Installed HASS.IO x86 https://www.home-assistant.io/blog/2017/11/29/hassio-virtual-machine/ Using the install script https://raw.githubusercontent.com/home-assistant/hassio-build/master/install/hassio_install

To Do

Radiator automation integration.