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
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
Make your MacOS keyboard brightness fade in and out

Make your MacOS keyboard brightness fade in and out. (It's working depends on the Kbrightness file, which only works for 2015 Macs, so this will only work on 2015 Macs.)

1 Dec 16, 2021
Nordpool_diff custom integration for Home Assistant

nordpool_diff custom integration for Home Assistant Requires https://github.com/custom-components/nordpool Applies non-causal FIR differentiator1 to N

Joonas Pulakka 45 Dec 23, 2022
A modular sequencer based on Pi Pico & EuroPi

PicoSequencer A modular sequencer based on Pi Pico & EuroPi by Zeno Van Moerkerke / Keurslager Kurt For now it is 'only' a trigger sequencer, but I si

5 Oct 27, 2022
Imbalaced Classification and Robust Semantic Segmentation

Imbalaced Classification and Robust Semantic Segmentation This repo implements two algoritms. The imbalance clibration (IC) algorithm for image classi

24 Jul 23, 2022
A simple Picobot project implemented in Python

Python-Picobot A simple Picobot project implemented in Python About Explanation This is my first programming project. Picobot use rules.txt file which

Shayan Shiravani 0 Apr 03, 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
This allows you to record keyboard and mouse input, and play it back using pynput.

Record and Play with Python! This allows you to record keyboard and mouse input, and play it back (with looping) using pynput. It allows for automatio

George Jensen 45 Jan 02, 2023
This is the remake of the program PYOBD. It works on Python3 and all new libraries. It was tested on Linux, Windows, and it should work on MAC too.

This is the remake of the program PYOBD. It works on Python3 and all new libraries. It was tested on Linux, Windows, and it should work on MAC too. You just need an ELM327 USB or bluetooth device and

127 Jan 06, 2023
Turn your Raspberry Pi Pico into a USB Rubber Ducky

pico-ducky Turn your Raspberry Pi Pico into a USB Rubber Ducky Install Requirements CircuitPython for the Raspberry Pi Pico adafruit-circuitpython-bun

Konstantinos 5 Nov 08, 2022
Extremely simple PyBadge examples to demonstrate different aspects of CircuitPython using PyBadge hardware.

BeginnerPyBadge I purchased a PyBadge recently. I'm new to hardware. I was surprised how hard it was to find easy examples demonstrating how different

Rubini LaForest 2 Oct 21, 2021
The example shows using local self-hosted runners on-premises by making use of a runner on a Raspberry Pi with LED's attached to it

The example shows using local self-hosted runners on-premises by making use of a runner on a Raspberry Pi with LED's attached to it

Martin Woodward 6 Nov 13, 2021
Pylorawan is a Micropython wrapper for lorawan devices from RAK Wireless.

pylorawan Pylorawan is a Micropython wrapper for lorawan devices from RAK Wireless. Tested on a Raspberry PI Pico with a RAK4200(H) Evaluation Board (

Peter Houghton 3 Nov 04, 2022
Intel Realsense t265 into Unreal Engine

t265_UE Intel Realsense t265 into Unreal Engine. Windows only, and Livelink plugin is 4.26.2 only at the moment. Might recompile it for different vers

Bjarke Aagaard 30 Jan 02, 2023
A python project based on a TV show Wheel of Fortune

Wheel-of-Fortune-using-Python Wheel of Fortune in python this game is the hands-on project in Python 3 Programming Specialization offered By Universit

Eszter Pai 1 Jan 03, 2022
Modi2-firmware-updater - MODI+ Firmware Updater With Python

MODI+ Firmware Updater 실행 준비 python3(파이썬3.9 혹은 그 이상의 버전)를 컴퓨터에 설치 python3 -m pip

LUXROBO 1 Feb 04, 2022
Pure micropython ESP32 SPI driver for sdcard and screen at the same SPI bus

micropython-esp32-spi-sdcard-and-screen-driver Proof of concept of Pure micropython espidf SPI driver for sdcard with screen at the same SPI bus (exam

Thomas Favennec 7 Mar 14, 2022
Andreas Frisch 1 Jan 10, 2022
An IoT Trivia app that shows you how to take a JSON web API such as the opentdb.com API and stream and display it on a FeatherS2 in an OLED display.

CircuitPython IoT Trivia ESP32-S2 OLED Version An IoT Trivia app that shows you how to take a JSON web API such as the opentdb.com API and stream and

Kevin Thomas 1 Nov 27, 2021
Mini Pupper - Open-Source,ROS Robot Dog Kit

Mini Pupper - Open-Source,ROS Robot Dog Kit

MangDang 747 Dec 28, 2022