Jarvis: Difference between revisions

From NURDspace
No edit summary
Line 8: Line 8:
}}
}}
Jarvis is the VM running Home Assistant ([http://hass.io HASS] ) on [[Coherence]] and is able to automate tasks in the space
Jarvis is the VM running Home Assistant ([http://hass.io HASS] ) on [[Coherence]] and is able to automate tasks in the space
See http://10.208.11.32/ or http://10.208.11.32:8123 when port 80 is not working.  Port 80 should work because of a port forward started from /etc/rc.local.
 
== Web interface ==
* http://10.208.11.32/ in case this does not work http://10.208.11.32:8123/
* user: nurds
* pass: same as wifi ask in the space
 
== Starting HASS ==
== Starting HASS ==
<pre>
Its automaticlly started within docker
/etc/init.d/homeassistant install
 
/etc/init.d/homeassistant start
iptables port forward: iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8123
</pre>
It should do this on boot through /etc/rc.local.


== Current Automations ==
== Current Automations ==
Line 25: Line 28:
=== OpenTherm Gateway===
=== OpenTherm Gateway===
OpenTherm gateway has been put between the heater and the thermostat, see [[OpenTherm_Gateway]]
OpenTherm gateway has been put between the heater and the thermostat, see [[OpenTherm_Gateway]]
=== Flukso ===
Runs stuff for power meter, see [[Flukso]].
=== EPC (PDU) ===
=== EPC (PDU) ===
https://gist.github.com/zarya/52b603146faac2b3d42e417532975054
https://gist.github.com/zarya/52b603146faac2b3d42e417532975054
Line 40: Line 41:


http://wiki.gude.info/FAQ_EPC_CmdLine
http://wiki.gude.info/FAQ_EPC_CmdLine
<pre><nowiki>
root@jarvis:/home/homeassistant/.homeassistant# cat switches.yaml
- platform: command_line
  switches:
    epc2_1:
      command_on: "/usr/bin/curl http://<IP>/SWOV.CGI?s1=1"
      command_off: "/usr/bin/curl http://<IP>/SWOV.CGI?s1=0"
      command_state: "/opt/epc/epccontrol2.pl --host=<IP> | grep 1"
      value_template: '{{ value == "1 is ON" }}'
      friendly_name: epc2 1
</nowiki></pre>


=== APC (PDU) ===
=== APC (PDU) ===
Line 71: Line 61:
   value_template: '{{ value | float / 10 }}'
   value_template: '{{ value | float / 10 }}'


</nowiki></pre>
OLD:
<pre><nowiki>
- platform: command_line
  name: pdu1_input_amps
  command: "snmpget -v1 -OvqU -c public 10.208.30.150 .1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1"
  unit_of_measurement: "A"
  value_template: '{{ value | multiply(10) }}'
</nowiki></pre>
</nowiki></pre>


Line 101: Line 82:
   version: "1"
   version: "1"


</nowiki></pre>
OLD:
<pre><nowiki>
    pdu1_1:
      command_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"
      command_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"
      command_state: "snmpget -v1 -OvqU -c public 10.208.30.150 .1.3.6.1.4.1.318.1.1.4.4.2.1.3.1"
      value_template: '{{ value == "1" }}'
      friendly_name: pdu1 1
</nowiki></pre>
</nowiki></pre>


Line 132: Line 103:
* Added grote zaal rechts (TL)
* Added grote zaal rechts (TL)
* Added Webcam connected to [[SlabPi]]
* Added Webcam connected to [[SlabPi]]
* Moved to hass.io


== New jarvis ==
== New jarvis ==
Line 156: Line 128:
** Amp meter
** Amp meter
* Migrate noname power bar scripts
* Migrate noname power bar scripts
* Migrate nurdbot notifier
* Migrate all automations


== Actions open ==
== Actions open ==
* Migrate nurdbot notifier
 
* Migrate all automations
 


=== Migration ===
=== Migration ===
Line 165: Line 139:
* Change the SNMP community for the APC to the right one for the new ip
* Change the SNMP community for the APC to the right one for the new ip


== Web interface ==
 
* user: nurds
* pass: same as wifi ask in the space




===To Do===
===To Do===
[[Radiator automation]] integration.
[[Radiator automation]] integration.

Revision as of 23:49, 6 March 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

Starting HASS

Its automaticlly started 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"

SonOff

- platform: mqtt
  name: "Grote zaal rechts"
  state_topic: "space/grotezaal/rechts/1/stat"
  command_topic: "space/grotezaal/rechts/1"
  qos: 0
  payload_on: "on"
  payload_off: "off"
  retain: true

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

New jarvis

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

The idea is to get the config from the old jarvis working and at some point have the new one take the IP address of the old one. For now the new one is configged with DHCP.

  • Temp IP: 10.208.42.142
  • User: nurds
  • Pass: the long one :)

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

Actions done

  • Add all mqtt sensors
  • Add all other config that works out of the box
  • Migrate APC power bar scripts
    • on/off
    • Amp meter
  • Migrate noname power bar scripts
  • Migrate nurdbot notifier
  • Migrate all automations

Actions open

Migration

  • Move the IP
  • Change the SNMP community for the APC to the right one for the new ip



To Do

Radiator automation integration.