From 529b2f70c4e78f9ad570b4af8346b1e84b73f395 Mon Sep 17 00:00:00 2001 From: Jochem Wildeboer <58041016+jtwild@users.noreply.github.com> Date: Wed, 7 Feb 2024 16:37:59 +0100 Subject: [PATCH 1/3] initial commit for demo instructions homeassistant --- .../demo_instructions.md | 204 ++++++++++++++++++ .../hello_world_mqtt_test.png | Bin 0 -> 56139 bytes 2 files changed, 204 insertions(+) create mode 100644 demos/homeassistant DSO schedules/demo_instructions.md create mode 100644 demos/homeassistant DSO schedules/hello_world_mqtt_test.png diff --git a/demos/homeassistant DSO schedules/demo_instructions.md b/demos/homeassistant DSO schedules/demo_instructions.md new file mode 100644 index 0000000..c3ea8a1 --- /dev/null +++ b/demos/homeassistant DSO schedules/demo_instructions.md @@ -0,0 +1,204 @@ +# Home Assistant with DSO profiles +These demo instructions describe a proof-of-concept set-up to get capacity profiles communicated by a DSO (Distribution System Operator, such as Liander) availble within Home Assistant. + +Please note these are *demo* instructions, as of February 2024 this solution is not in production. + + * [Assumed pre-installed configurations](#assumed-pre-installed-configurations) + * [Initial configuration](#initial-configuration) + * [Configuring a local MQTT broker (optional)](#configuring-a-local-mqtt-broker-optional) + * [Connecting to the MQTT broker](#connecting-to-the-mqtt-broker) + * [Direct connection](#direct-connection) + * [Bridged connection](#bridged-connection) + * [Setting up an MQTT sensor](#setting-up-an-mqtt-sensor) + * [Adding](#adding-) + * [Creating an automation](#creating-an-automation) + * [Visualization](#visualization) + * [History only using build-in card](#history-only-using-build-in-card) + * [History and future using apex-charts](#history-and-future-using-apex-charts) + * [Demo time!](#demo-time) + +## Assumed pre-installed configurations +Before we start, you are assumed to have the following working: +1. A Hedera endpoint for which capacity profiles are published #todo link to Daniel +2. A Hedera gateway to request capacity profiles (optional) #todo link to Daniel +3. An MQTT broker. +4. Flegepower set up and running, publishing MQTT messages to the above broker +5. A power measurement measuring some connection +6. A controllable load connected to that same connection + +For point 5 and 6, this demo uses a Zigbee power outlet plug with integrated power measurement. In a real use-case, the controllable load could also be an EV charging point, a heat pump, solar panels or anything else. + +## Initial configuration +We need to do some initial setups. +### Configuring a local MQTT broker (optional) +You need an MQTT broker. It is possible to use a local MQTT broker within Home Assistant. Alternatively you can use a broker hosted elsewhere and skip this step. +1. Install the [Mosquitto MQTT broker add-on](https://github.com/home-assistant/addons/blob/master/mosquitto/DOCS.md) +2. Optional, create a custom user/pass combination by going to [Add Ons → Mosquitto → Configuration ](https://my.home-assistant.io/redirect/supervisor_addon/?addon=core_mosquitto)→ Edit in YAML → Add the snippet below: +```yaml +logins: + - username: supercoolusername + password: supersavepassword +``` + +### Connecting to the MQTT broker +#### Direct connection +1. Add the [MQTT integration](https://www.home-assistant.io/integrations/mqtt) with your broker. +2. Test if the server works + 1. Go to your MQTT integration configuration + 2. In ‘Listen to a topic, start listening to ‘hello’ + 3. In ‘Publish a packet’, publish in topic ‘hello’ with payload ‘world’. Alternatively, you can make a service call as below: +```yaml +service: mqtt.publish +data: + topic: hello + payload: "world" +``` +3.You should see your MQTT message pop up in the ‘Listen to a topic field’: + + + +#### Bridged connection +HomeAssistant can only run a single MQTT broker. If a user already has an existing MQTT broker connected, he cannot connect to the one used by Fledgepower. Solutions are: +- Fledgepower connects to the existing broker (not suitable for local brokers if fledgepower is not running on the same local network as the broker) +- The existing broker creates a [bridge](https://mosquitto.org/man/mosquitto-conf-5.html) connection to the Fledgepower-used broker + +Below we explains how to set-up the latter in Home Assistant using the Mosquitto add-on. +1. Set up your MQTT broker normally +2. Create an .conf file in `/share/mosquitto/`, for example `/share/mosquitto/bridge_example.conf`. +This can be done using the File editor add-on. Make sure to disable the `Enforce basepath` option in the configuration, such that you have root acces. +3. In the .conf file, add at least the following: +```yaml +connection some_name +address
:bl3A-BLkj$3(qrrcrMBBoB;0(K z4La?TI4Yf&v@}<>VxY$9<|r1T{2X#&<2Q7v@mC9fFEP(*0;D@_H6|u@uCLLh$hq$Q z+XI0P$l-l@f5@VU_XImld%V_XhE!DFYs`-@SNil+SzR?`M}J}chy2(RF3d|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