Home Assistant connector for Pimatic
npm install pimatic-hassThis plugin is using the mqtt discovery function of Home Assistant (Hass) to automaticaly add pimatic devices. For actionable devices like switch or light the Pimatic devices are synced with Home Assistant. For readonly devices the values are only exposed readable towards Home Assistant.
The communication between Pimatic and Hass is done via mqtt. You need to use a mqtt server that is preferably on your local netwerk.
```
mqtt:
broker:
username:
password:
port:
discovery: true
discovery_prefix: hass
birth_message:
topic: 'hass/status'
payload: 'online'
will_message:
topic: 'hass/status'
payload: 'offline'
It's important to use in Hass the same discovery_prefix you are using in the Pimatic plugin. Otherwise the automatic installation of devices will not work. The discover_topic and the first part of the birth_message/will-message topic must be the same. Default 'hass' is used.
If you change the discovery_prefix in the plugin config, you must also change these 3 values in home-assistant's configuratio.yaml.
Now you can add the MQTT integration in Home Assistant.
Goto to the settings menu and select integrations. Pusg the add button (+) and type mqtt.
The MQTT integration will showup and you can select and install it.
Fill in the MQTT server parameters from your mqtt server. Save and exit.
The preparation of Home Assistant is done!
``
mqttServer: The ip adress of the mqtt server
mqttUsername: The username for the mqtt server
mqttPassword: The password for the mqtt server
mqttPort: The portnumber of the mqtt api
default: 1883
discovery_prefix: The discovery topic for hass
default: "hass"
device_prefix: A pimatic style prefix for all device to identify them
default: "pimatic"
debug: Debug mode. Writes debug messages to the pimatic log, if set to true.
default: false
The discovery_prefix must be the same as used in the Hass configuration.yaml. The device_prefix is used to identify devices in HAss coming from this pimatic system.
In the Hass device you can add Pimatic devices by there pimatic-id. No further configuration is needed.
After saving the device config, the the configuration is updated towards Home Assistant and per pimatic device that you added in the device config a compatible Hass device is created in Home Assistant.
The device type of a Pimatic device determines the Home assistant Device type that is created in Home Assistant device.
Currently the following types of Pimatic devices are supported.
|Pimatic |direction | Hass | States
|------------|:--------:|----------|-------------------|
|Switch | 2-way | Switch | on/off
|Presence | 1-way | Binary | motion (not) detected
|Light | 2-way | Light | light on/off, brightness
|Contact | 1-way | Binary | opened/closed
|Sensor | 1-way | Value | all attributes
|Variables| 1-way | Variable | variable value
|Thermostat| 2-way | Thermostat | off/heat/auto, setpoint, temperature
|Shutter| 2-way | Cover | up / down /stop
|Alarmpanel| 2-way | Alarmpanel | disarm, arm (home, away or night)
If you add a device thats is not a switch, motion sensor, light or contact, a SensorDevice will be created for every attribute of that device.
If you want to use a specific set of variables, from for example different devices. You need to use a VariablesDevice. Add to the VariablesDevice the desired variables and add the VariableDevice (id) to the Hass device config.
The supported Thermostats are DummyHeatingThermostat (pimatic default) and DummyThermostat (pimatic-dummies).
For the Shutter a DummyShutter device can be used.
For the Alarmpanel a specific DummyAlarmPanel device is created in pimatic-dummies. With this device you can create an Alarm Panel in home-assistant. For more informatie see pimatic-dummies.
The Hass device name is:
``
The "pimatic attribute-id" is used for variables, button and sensor devices
The related Hass device friendly name is: (shows on the HAss gui)
``
For the VariablesDevice or the SensorDevice the Hass device is
```
sensor.
In the Hass Gui you can group sensors and variables on 1 card.
When you remove a Pimatic device from the config, in Home Assistant the card will get yellow and show the message 'entity not available'. You need to remove the card if you want to get rid of this message. If you leave the card in the Gui the entity becomes active again when you add the same Pimatic device again to the config.
It is possible to connect multiple Pimatic systems to 1 Home Assistant. Per Pimatic system you install the plugin and configure devices as described above. Is Home Assistant all the devices from the different Pimatic sysyem are available. When you use the same pimatic-id's for the same type of device in different Pimatic systems, Hass will add a '\_\
---
The minimum node requirement for this plugin is node v10!
You could backup Pimatic before you are using this plugin!