Home-Assistant MQTT bridge for Panasonic Comfort Cloud

Overview

Panasonic Comfort Cloud MQTT Bridge

Home-Assistant MQTT bridge for Panasonic Comfort Cloud.

Note: Currently this brige is a one evening prototype project. Main features should work but corner cases will definitely cause problems. Current version has only been tested with model CS-HZ25UKE. Let me know if you hit any issues.

HA

Uses pcomfortcloud for Panasonic Comfort Cloud and paho-mqtt for MQTT.

Features

  • Auto-discovery notification for HA
  • Operating mode support
  • Target temperature support
  • State verification updates

Usage

usage: run.py [-h] [-u USERNAME] [-P PASSWORD] [-s SERVER] [-p PORT] [-t TOPIC]

Home-Assistant MQTT bridge for Panasonic Comfort Cloud

optional arguments:
-h, --help            show this help message and exit
-u USERNAME, --username USERNAME
                        Panasonic Comfort Cloud username, usually email address. Environment variable `USERNAME`
-P PASSWORD, --password PASSWORD
                        Panasonic Comfort Cloud password. Environment variable `PASSWORD`
-s SERVER, --server SERVER
                        MQTT server address, default `localhost`. Environment variable: `MQTT`
-p PORT, --port PORT  MQTT server port, default 1883. Environment variable `MQTT_PORT`
-t TOPIC, --topic TOPIC
                        MQTT discovery topic prefix, default `homeassistant`. Environment variable TOPIC_PREFIX.

Example install / use,

pip3 install .
python3 run.py -u [email protected] -P 123password -s 127.0.0.1

Missing Features

High Priority

  • Error handling in general
  • Proper entity id generation (currenlty will fail with really wild names)
  • Additonal sensors for inside and outside temperature
  • Proper documentation
  • Docker package
  • Proper shutdown

Maybe Someday

  • Fan mode support
  • Support for Eco mode
  • Support for Nano mode
  • Fan speed support
  • Service state events
  • Stop listening to all events in HA topic
  • Power usage metrics
Comments
  • Comfort Cloud API returning `Forbidden`

    Comfort Cloud API returning `Forbidden`

    About

    Currently the Comfort Cloud API is returning forbidden due to app version mismatch. pcomfortcloud needs to be updated once the problem has been resolved in the underlying library.

    Related Issue

    https://github.com/lostfields/python-panasonic-comfort-cloud/issues/64

    bug 
    opened by slvwolf 2
  • Fix version mismatch

    Fix version mismatch

    About

    Address error coming from version mismatch -

    Traceback (most recent call last):
      File "/app/pcfmqtt/service.py", line 83, in start
        if device.update_state(self._session, self._update_interval):
      File "/app/pcfmqtt/device.py", line 92, in update_state
        data = session.get_device(self._id)
      File "/usr/local/lib/python3.9/site-packages/pcomfortcloud/session.py", line 274, in get_device
        raise ResponseError(response.status_code, response.text)
    pcomfortcloud.session.ResponseError: Invalid response, status code: 401 - Data: {"message":"New version app has been published","code":4106}
    

    Related

    • https://github.com/lostfields/python-panasonic-comfort-cloud/issues/71
    enhancement 
    opened by slvwolf 0
  • Reset MQTT and Cloud connection on error

    Reset MQTT and Cloud connection on error

    About

    When encountering serious error even after re-attempt reset the MQTT and Comfort Cloud connection to start from fresh

    Workaround fix for forbidden problem #13

    Temporarily fixes version problem in library dependency causing forbidden when logging in

    enhancement 
    opened by slvwolf 0
  • Handle expiring token

    Handle expiring token

    System can get stuck with the following error message -

    Sequence of errors detected. Halting requests for 10 minutes: ResponseError('Invalid response, status code: 401 - Data: {"message":"Token expires","code":4100}')

    bug good first issue 
    opened by slvwolf 0
  • Entity update thread blocked

    Entity update thread blocked

    Main service thread responsible for updating sensor information can get stuck after long running time. Both MQTT and PCC sessions are alive and working even when thread is blocked.

    bug 
    opened by slvwolf 0
  • Error handling in general

    Error handling in general

    Project needs some tests and real life testing for properly identify the breaking parts. At minimum handle MQTT errors and sessions errors when communicating with Panasonic Comfort Cloud.

    bug enhancement 
    opened by slvwolf 0
  • Handle crashes from error code 503

    Handle crashes from error code 503

    System will crash if encountering error code 503 for a long period of time

    2022-09-20 01:01:50,360 - Service - WARNING - Sequence of errors detected. Halting requests for 10 minutes: ResponseError('Invalid response, status code: 503 - Data: {"message":"09/20/2022 01:00 ~ 09/20/2022 03:00 (UTC ± 00)","code":5300}')
    2022-09-20 01:11:50,455 - Service - INFO - Resetting connection
    2022-09-20 01:11:50,455 - Service - INFO - Connecting to Panasonic Comfort Cloud..
    2022-09-20 01:11:52,949 - Service - INFO - Shutting down
    Traceback (most recent call last):
      File "/app/run.py", line 4, in <module>
        __main__.main()
      File "/app/pcfmqtt/__main__.py", line 42, in main
        s.start()
      File "/app/pcfmqtt/service.py", line 79, in start
        self.connect_to_cc()
      File "/app/pcfmqtt/service.py", line 45, in connect_to_cc
        self._session.login()
      File "/usr/local/lib/python3.9/site-packages/pcomfortcloud/session.py", line 99, in login
        self._create_token()
      File "/usr/local/lib/python3.9/site-packages/pcomfortcloud/session.py", line 132, in _create_token
        raise ResponseError(response.status_code, response.text)
    pcomfortcloud.session.ResponseError: Invalid response, status code: 503 - Data: {"message":"09/20/2022 01:00 ~ 09/20/2022 03:00 (UTC ± 00)","code":5300}
    
    bug 
    opened by slvwolf 0
Releases(v0.4.2)
  • v0.4.2(Oct 14, 2022)

  • v0.4.1(Jul 14, 2022)

    Improvements,

    • Automatic reset of MQTT connection and Panasonic Comfort Cloud when encountering unhandled exceptions

    Fixes,

    • Workaround fix applied to go around issue with API returning forbidden
    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(May 22, 2022)

    Features,

    • Desired state support. Instead of trusting the Comfort Cloud to keep the current state when turning the device off, use own state instead. If service is restarted the desired state is retrieved from the cloud. This helps with retaining the mode state when turning the device on and off.
    • Improved logging. Plenty of additional details are now provided with nicer syntax. Logging level can be controlled with environment variable if needed.

    Improvements,

    • Better responsiveness. New states should be much faster reflected in Home Assistant.
    Source code(tar.gz)
    Source code(zip)
  • v0.3.3(Feb 6, 2022)

  • v0.3.1(Jan 14, 2022)

  • v0.3.0(Jan 8, 2022)

    Features,

    • Respects HA birth and last will events. Service will now resend all configuration when detecting Home Assistant was restarted. In addition configuration will be refreshed every 60 minutes in case HA status messages are missed.
    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Jan 8, 2022)

  • v0.2.0(Jan 8, 2022)

    Incremental feature updates,

    • Temperature sensors for outside and inside
    • Delayed device update on state changes
    • Own power command for retaining the original mode state in device
    • Proper shutdown when running from terminal
    • Correct HA icons and types for entities
    Source code(tar.gz)
    Source code(zip)
  • v0.1(Jan 7, 2022)

    First working prototype with following features,

    • Auto-discovery notification for HA
    • Operating mode support
    • Target temperature support
    • State verification updates
    Source code(tar.gz)
    Source code(zip)
Owner
Santtu Järvi
Data-wolf engineer
Santtu Järvi
Connect a TeslaMate instance to Home Assistant, using MQTT

TeslaBuddy Connect a TeslaMate instance to Home Assistant, using MQTT. It allows basic control of your Tesla vehicle via Home Assistant (currently, ju

null 4 May 23, 2022
Iec62056-21-mqtt - Publish DSMR P1 telegrams acquired over IEC62056-21 to MQTT

IEC 62056-21 Publish DSMR P1 telegrams acquired over IEC62056-21 to MQTT. -21 is

Marijn Suijten 1 Jun 5, 2022
View your medication from Medisafe Cloud in Home Assistant

Medisafe View your medication from Medisafe Cloud in Home Assistant. This integration adds sensors for today's upcoming, taken, skipped, and missed do

Sam Steele 12 Dec 27, 2022
Universal Xiaomi MIoT integration for Home Assistant

Xiaomi MIoT Raw 简体中文 | English MIoT 协议是小米智能家居从 2018 年起推行的智能设备通信协议规范,此后凡是可接入米家的设备均通过此协议进行通信。此插件按照 MIoT 协议规范与设备通信,实现对设备的状态读取及控制。

null 1.9k Jan 2, 2023
Volkswagen ID component for Home Assistant

Volkswagen ID component for Home Assistant This folder contains both a generic Python 3 library for the Volkswagen ID API and a component for Home Ass

null 55 Jan 7, 2023
Sensor of Temperature Feels Like for Home Assistant.

Please ⭐ this repo if you find it useful Sensor of Temperature Feels Like for Home Assistant Installation Install from HACS (recommended) Have HACS in

Andrey 60 Dec 25, 2022
Home Assistant custom integration for e-distribución

e-Distribución is an energy distribution company that covers most of South Spain area. If you live in this area, you probably are able to register into their website to get some information about your power demand, energy consumption, or even cycle billing (in terms of consumptions).

VMG 17 Sep 7, 2022
Home Assistant custom integration for Yi cameras: yi-hack-MStar, yi-hack-Allwinner and yi-hack-Allwinner-v2

yi-hack Home Assistant integration Overview yi-hack Home Assistant is a custom integration for Yi cameras (or Sonoff camera) with one of the following

roleo 131 Jan 3, 2023
Интеграция Home Assistant с ЛК "Интер РАО"

ЕЛК ЖКХ «Интер РАО» для Home Assistant Предоставление информации о текущем состоянии ваших аккаунтов в ЕЛК ЖКХ. Введение @ TODO @ Установка Посредство

Alexander Ryazanov 27 Nov 5, 2022
Provide Unifi device info via api to Home Assistant that will give ap sensors

Unifi AP Device info Provide Unifi device info via api to Home Assistant that will give ap sensors

null 12 Jan 7, 2023
Switch predictor for Home Assistant with AppDeamon

Home Assistant AppDeamon - Event predictor WORK IN PROGRESS - CURRENTLY NOT COMPLETE AND NOT WORK This is an idea under development (when I have free

null 37 Dec 17, 2022
Uses the Duke Energy Gateway to import near real time energy usage into Home Assistant

Duke Energy Gateway This is a custom integration for Home Assistant. It pulls near-real-time energy usage from Duke Energy via the Duke Energy Gateway

Michael Meli 28 Dec 23, 2022
Custom component for Home Assistant that integrates Candy/Haier Wi-Fi washing machines (also known as Simply-Fi).

Candy Home Assistant component Custom component for Home Assistant that integrates Candy/Haier Wi-Fi washing machines (also known as Simply-Fi). This

Olivér Falvai 61 Dec 29, 2022
Home Assistant integration for energy consumption data from UK SMETS (Smart) meters using the Hildebrand Glow API.

Hildebrand Glow (DCC) Integration Home Assistant integration for energy consumption data from UK SMETS (Smart) meters using the Hildebrand Glow API. T

Aniket 153 Dec 30, 2022
emhass: Energy Management for Home Assistant

emhass EMHASS: Energy Management for Home Assistant Context This module was conceived as an energy management optimization tool for residential electr

David 70 Dec 24, 2022
Electrolux Pure i9 robot vacuum integration for Home Assistant.

Home Assistant Pure i9 This repository integrates your Electrolux Pure i9 robot vacuum with the smart home platform Home Assistant. The integration co

Niklas Ekman 15 Dec 22, 2022
Huawei Solar sensors for Home Assistant

Huawei Solar Sensors This integration splits out the various values that are fetched from your Huawei Solar inverter into separate HomeAssistant senso

Thijs Walcarius 151 Dec 31, 2022
Baseline model for Augmented Home Assistant

Dataset Preparation Step 1. Rename the Virtual-Home output directory to 'vh.[name]', for example: 'vh.door' Make sure the directory contains 100+ fram

Stanford HCI 1 Aug 24, 2022
Better support for Nuki devices to the Home Assistant

Another attempt to add a better support for Nuki devices to the Home Assistant Features: Lock interface implementation Uses local webhook from bridge

Konstantin 105 Jan 7, 2023