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
Various programs in Atari BASIC for #FujiNet for Atari 8-bit

FujiNet Various programs in Atari BASIC for #FujiNet for Atari 8-bit FujiNet-3D Tic Tac Toe In 1978, Scott Adams wrote a 3-D Tic Tac Toe game, for pla

Kay Savetz 2 Jan 01, 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
Brogrammer-keyboard - FIrmware for the Brogrammer Keyboard v1.0

Brogrammer Keyboard Firmware The package contains the firmware that runs on the Brogrammer Keyboard v1.0 See https://imgur.com/a/oY5QZ14 This keyboard

Devin Hartleben 1 Apr 21, 2022
Ha-rpi gpio - Home Assistant Raspberry Pi GPIO Integration

Home Assistant Raspberry Pi GPIO custom integration This is a spin-off from the

Shay Levy 98 Dec 24, 2022
Hook and simulate global keyboard events on Windows and Linux.

keyboard Take full control of your keyboard with this small Python library. Hook global events, register hotkeys, simulate key presses and much more.

BoppreH 3.2k Dec 30, 2022
Like htop (CPU and memory usage), but for your case LEDs. 😄

Like htop (CPU and memory usage), but for your case LEDs. 😄

Derek Anderson 3 Dec 08, 2021
A python file which I wrote to allow the Dorna Robots API to draw an Image on a 3D plane

Dorna-Robotics-Internship Code In the directory "Code" is a python file which I wrote to allow the Dorna Robots API to draw an Image on a 3D plane. I

Stephen Otto 2 Dec 06, 2021
This repository hosts the code for Stanford Pupper and Stanford Woofer, Raspberry Pi-based quadruped robots that can trot, walk, and jump.

This repository hosts the code for Stanford Pupper and Stanford Woofer, Raspberry Pi-based quadruped robots that can trot, walk, and jump.

Stanford Student Robotics 1.2k Dec 25, 2022
Andreas Frisch 1 Jan 10, 2022
Python apps to assist with Gas Blending

Welcome to DiveTools Gas Blending This tool is for testing and educational use. It is not intended to confirm the mix of breathing gases. If this tool

Tucker 7 Sep 18, 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 03, 2023
ArucoFollow - A script for Robot Operating System and it is a part of a project Robot

ArucoFollow ArucoFollow is a script for Robot Operating System and it is a part

5 Jan 25, 2022
The robot is an autonomous small scale racing car using NVIDIA Jetson Nano.

The robot is an autonomous small scale racing car using NVIDIA Jetson Nano. This project utilizes deep learning neural network framework Keras/Tensorflow, together with computer vision library OpenCV

1 Dec 08, 2021
Homeautomation system created with Raspberry Pi 3 and Firebase.

Homeautomation System - Raspberry Pi 3 Desenvolvido com Python, Flask com AJAX e Firebase permite o controle local e remoto Itens necessários Raspberr

Joselino Santos 0 Mar 09, 2022
A script that publishes power usage data of iDrac enabled servers to an MQTT broker for integration into automation and power monitoring systems

iDracPowerMonitorMQTT This script publishes iDrac power draw data for iDrac 6 enabled servers to an MQTT broker. This can be used to integrate the pow

Lucas Zanchetta 10 Oct 06, 2022
Tool to create 3D printable terrain with integrated path/road part files (Single material 3d printer)

BACKGROUND This has been an ongoing project of mine for a few months now. I run trails a lot and original the goal was to create a function to combine

9 Apr 26, 2022
Activate Numpad inside the touchpad with top right corner switch or F8 key

This is a python service which enables switching between numpad and touchpad for the Asus UX433. It may work for other models.

Mohamed Badaoui 230 Jan 08, 2023
Programmable Rainbow Redstone Computer

Programmable Rainbow Redstone Computer Table of contents What is it? Program flasher How to use it What is it? PRRC is Programmable Rainbow Redstone C

Fern H 2 Jun 07, 2022
Fener ROS2 package version 2

Fener's ROS2 codes that runs on the vehicle. This node contains basic sensing and actuation nodes for vehicle control. Also example applications will be added.

Muhammed Sezer 1 Jan 18, 2022
Drobo Status is a python program that will connect to your Drobo and return JSON data regarding your Drobo

This is a simple python script that will run a docker container to pull data from Drobo. It will give information like (Name, serial, firmware, disk-total, disk-used, disk-free and individual disk st

Biofects 1 Jan 15, 2022