Comfort Automation/ Security System Forums > Software Applications > Comfort with Home Assistant > MultiSensor Module MSM01 Temperature and Humidity in Home Assistant |
Moderated by: slychiu |
Author | Post | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
slychiu Administrator ![]()
|
The Multisensor Module MSM01 has internal sensors for Temperature & Humidity as well as connections to water leakage detection cable for Water Leakage. It also has 4 external inputs for Dry contacts which can trigger alarms or Responses in Comfort. ![]() see http://www.comfortforums.com/forum139/4919.html for more info. The temperature and Humidity can be mapped to Comfort Sensors eg ![]() The Comfort 2 mqtt addon in Home Assistant can be configured to display the temperature and Humidity sensors on the dashboard, eg Entry in configuration.yaml - name: Temperature unique_id: "comfort2_sensor1" state_topic: "comfort2mqtt/sensor1" value_template: "{{ value_json.Value }}" availability_topic: "comfort2mqtt/alarm/online" json_attributes_template: "{{ value_json | tojson }}" json_attributes_topic: "comfort2mqtt/sensor1" device_class: temperature state_class: measurement unit_of_measurement: °C payload_available: "1" payload_not_available: "0" - name: Humidity unique_id: "comfort2_sensor2" state_topic: "comfort2mqtt/sensor2" value_template: "{{ value_json.Value }}" availability_topic: "comfort2mqtt/alarm/online" json_attributes_template: "{{ value_json | tojson }}" json_attributes_topic: "comfort2mqtt/sensor2" device_class: humidity state_class: measurement unit_of_measurement: "%" payload_available: "1" payload_not_available: "0" the dashboard should show ![]() ![]() Last edited on Thursday Apr 24th, 2025 05:37 am by slychiu |
|||||||||
slychiu Administrator ![]()
|
It is possible to graph the sensor values on the dashboard using the built in graphing tool in Home Assistant.![]() The graph above is done by editing the Dashboard Raw configuration Editor. views: - title: Home cards: - type: history-graph entities: - entity: sensor.temperature - entity: sensor.humidity hours_to_show: 24 refresh_interval: 60 views: - title: Home cards: - type: statistics-graph entities: - entity: sensor.temperature - entity: sensor.humidity chart_type: line period: hour This can be viewed live at our demo system http://slychiu.ddns.net:9000/dashboard-environment/0 user name: comfortpassword Cytech408935 Last edited on Friday Apr 11th, 2025 06:29 am by slychiu |
|||||||||
slychiu Administrator ![]()
|
Temperature and Humidity Storage and Graphical Display using InfluxDb and Grafana InfluxDB and Grafana are powerful tools that, when integrated with Home Assistant, significantly enhance its data logging, storage, and visualization capabilities. Here's a breakdown of what each does in the context of Home Assistant: InfluxDB
Grafana
In Summary InfluxDB and Grafana work together in Home Assistant to provide a robust solution for long-term data logging and visualization: Home Assistant collects data from your smart home devices and integrations. The InfluxDB integration in Home Assistant sends this data to the InfluxDB time series database for efficient and long-term storage. Grafana connects to the InfluxDB database and allows you to create customizable dashboards with various visualizations to analyze and monitor this historical data. These Grafana dashboards or individual panels can then be embedded back into your Home Assistant interface for seamless access to detailed insights about your smart home. This combination provides significant advantages over Home Assistant's built-in history capabilities, especially for users who want to track trends over longer periods, analyze their data in more detail, and create custom monitoring dashboards. This youtube video from Smart Home Australia shows how to install and configure InfluxDB and Grafana in Home Assistant https://www.youtube.com/watch?v=k-7dO1o52dQ This is an example graph of temperature and Humidity obtained from the MSM sensors using InfluxDb and Grafana ![]() Last edited on Friday Apr 11th, 2025 03:29 am by slychiu |
|||||||||
slychiu Administrator ![]()
|
InfluxDb installation and Configuration In Home Assistant, go to Settings > AddOns, press AddOn Store at the bottom right. Search for InfluxDb and select it . Press Install. turn on Start on Boot, Watchdog, and Show in Sidebar, There is no configuration required, so just press the START button. You will see InfluxDB in the left sidebar. On the left of the InfuxDb screen, press the Crown icon for Admin In top left corner press Create Database. Enter a database name eg homessistant and press the green Tick on the right. Add a retention policy. This is the duration that the data will be stored in the InfluxDb database. Note that the longer the duration, the more flash memory will be used in Raspberry Pi. ![]() ![]() Next Go to the users Tab on the top menu and create a user and password. ![]() Give the user permission to read and write to the database. Update the configuration.yaml file using File Editor. Add the following; influxdb: host: a0d7b954-influxdb port: 8086 database: homeassistant username: <your username> password: <tour password> max_retries: 3 default_measurement: state Restart Home Assistant. After restart, go back to InfluxDb in the sidebar. Go to Explore (the graph icon), Go to Query1, select your hoe assistant database called "homeassistant" To the right you should see measurement units like %, 0C etc ![]() for %, open the entity ID list, you should see humidity in the list ![]() ![]() You do not have to select the humidity For 0C open the entity ID list- you should see temperature in the list. These are the entities that are passed on to Grafana. ![]() Last edited on Friday Apr 11th, 2025 05:10 am by slychiu |
|||||||||
slychiu Administrator ![]()
|
Grafana Installation and Configuration Go to Settings > Add on Store, press AddOn Store at the bottom right. Search for Grafana and select it . Press Install. turn on Start on Boot, Watchdog, and Show in Sidebar, There is no configuration required, so just press the START button. Go to Grafana in the Sidebar. Press the orange symbol on the top left hand corner of Grafana. go to Connections on the left menu and Add new Connection. Search For InfluxDB and select it ![]() Press the ADD new data source in the top right. This connects InfluxDB data to Grafana. in the influxDb connection screen enter the IP address with port 8086 ![]() scroll down to influxDB Details and enter the database, username and password for the database Then press Save and Test. you should see a green tick and a message that the data source is working. ![]() Next use Grafana toi create a new dashboard for temperature and Humidity.Prss the + symbol on the topright corner and Add a new Dashboard. select Add Visualization. select DataSource as InfluxDB in select measurements there are a list if units eg %, 0C select 0C for WHERE press + to select entity_id and in tag value search for temperature ![]() you can add another visualisation on the same page eg Humidity ![]() If the dashboard configuration is correct you should se the graphs for temperature and humidity on the Grafana Dashboard ![]() ![]() Please take a look at the Youtube video at https://www.youtube.com/watch?v=k-7dO1o52dQ for more information about how to customise the graphs Last edited on Friday Apr 11th, 2025 06:35 am by slychiu |
|||||||||
slychiu Administrator ![]()
|
Data from the graph can be exported to a csv file. go to the visualisation eg Temperature graph. click on the 3 dots on the top left of the visualisation, select Inspect > Data ![]() The date and time range for the exported data can be selected in the Time Picker ![]() Last edited on Friday Apr 11th, 2025 07:36 am by slychiu |
|||||||||
slychiu Administrator ![]()
|
The temperature and Humidity Graphs in Grafana can be viewed Live on our Demo Home assistant in the office at http:// http://slychiu.ddns.net:9000/a0d7b954_grafana/ingress user name = comfort password = Cytech408935 |