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
Python Wrapper for Homeassistant's REST API

HomeassistantAPI Python Wrapper for Homeassistant's REST API Please ⭐️ the repo if you find this project useful or cool! Here is a quick example. from

Nate 29 Dec 31, 2022
Inykcal is a software written in python for selected E-Paper displays.

Inykcal is a software written in python for selected E-Paper displays. It converts these displays into useful information dashboards. It's open-source, free for personal use, fully modular and user-f

Ace 727 Jan 02, 2023
Monitor Live USB Plug In & Plug Out Events

I/O - Live USB Monitoring Author: Jonathan Scott @jonathandata1 Date: 3/13/2021 CURRENT VERSION 1.0 This is just a simple bash script that calls a pyt

Jonathan Scott 17 Dec 03, 2022
Code for the paper "Planning with Diffusion for Flexible Behavior Synthesis"

Planning with Diffusion Training and visualizing of diffusion models from Planning with Diffusion for Flexible Behavior Synthesis. Guided sampling cod

Michael Janner 310 Jan 07, 2023
Pinion — Nice-looking interactive diagrams for KiCAD PCBs

Pinion — Nice-looking interactive diagrams for KiCAD PCBs Pinion is a simple tool that allows you to make a nice-looking pinout diagrams for your PCBs

Jan Mrázek 297 Jan 06, 2023
Control the lights of Alienware computers under GNU/Linux systems.

Before requesting support please consider that this software is not actively developed. I created it in 2014 for managing my Alienware M14X-R1 (where

rsm 111 Dec 05, 2022
🌱 - WebhookHard◞ Fines Educativos ◟

v1.0.0 WebhookHardware ¿Que es WebhookHardware? WebhookHardware se trata de un proyecto tratado para sacar informacion sobre el hardware de tus victim

3 Jun 14, 2021
Implementation of Forwards Kinematics, Inverse Kinematics, Point to Point Movement and Synchronous movement for Kuka KR 120 R2700-2.

I made this project for my university course in robotics. I rarely found any information regarding the implementation of mathematics in code. So I decided to make this repo in order to help others :)

2 Dec 27, 2022
Micropython automatic watering

micropython-automatic-watering micropython automatic watering his code was developed to be used with nodemcu esp8266, but can be modified to work with

1 Nov 24, 2021
Examples to accompany the

Examples to accompany the "Raspberry Pi Pico Python SDK" book published by Raspberry Pi Trading, which forms part of the technical documentation in support of Raspberry Pi Pico and the MicroPython po

Raspberry Pi 589 Jan 08, 2023
A global contest to grow and monitor your own food with Raspberry Pi

growlab A global contest to grow and monitor your own food with Raspberry Pi A capture from phototimer of my seed tray with a wide-angle camera positi

Alex Ellis 442 Dec 23, 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
A blender 2.9x addon for managing camera settings

TMG-Camera-Tools A blender 2.9x addon for managing camera settings Tutorial showcasing current features

Mainman002 12 Apr 16, 2022
A Fast, Easy, and User Friendly way to control Robotics Actuators.

T-Motor Controller A Fast, Easy, and User Friendly way to control Robotics Actuators. View Demo · Report Bug · Request Feature Table of Contents About

26 Aug 23, 2022
Example code to sending USB Gadget multimedia keys via Python

Send Multimedia USB HID Keys via Python As an USB Gadget in Linux This gives a simple script with zero dependencies that can easily run on any Linux d

DevOps Nirvana 2 Jan 02, 2023
ModbusTCP2MQTT - Sungrow & SMA Solar Inverter addon for Home Assistant

ModbusTCP2MQTT Sungrow & SMA Solar Inverter addon for Home Assistant This addon will connect directly to your Inverter using Modbus TCP. Support model

Teny Smart 40 Dec 21, 2022
Simples Keylogger para Windows com um autoboot implementado no sistema

MKW Keylogger Keylogger simples para Windos com um autoboot implementado no sistema, o malware irá capturar pressionamentos de tecla e armazená-lo em

3 Jul 03, 2021
Python library to interact with the GCE Electronics IPX800 device

A python library to control a GCE-Electronics IPX800 V4 device through its API.

Marc-Aurèle Brothier 2 Oct 20, 2021
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

12 Jan 07, 2023
Automatically draw a KiCad schematic for a circuit prototyped on a breadboard.

Schematic-o-matic Schematic-o-matic automatically draws a KiCad schematic for a circuit prototyped on a breadboard. How It Works The first step in the

Nick Bild 22 Oct 11, 2022