Coder Social home page Coder Social logo

Mode about homebridge-thermostat HOT 14 CLOSED

pjczx avatar pjczx commented on September 9, 2024
Mode

from homebridge-thermostat.

Comments (14)

PJCzx avatar PJCzx commented on September 9, 2024

You should set the TargetState and your system will set the state depending of the temparature: eg

TargetState > AUTO will give State > Heating or Cooling depending of the temperature.

Sure you can set target state Heating or cooling.

Let me know if not clear.

from homebridge-thermostat.

paulkoene avatar paulkoene commented on September 9, 2024

I would like to set the targetstate with the homekit widget. How will the plugin pass the targetstate to the script on the webserver (something like http://host/targetstate/auto)

from homebridge-thermostat.

PJCzx avatar PJCzx commented on September 9, 2024

Using the iOS Home app will allow you to chose different values that will invoque the 'setTargetHeatingCoolingState()' function. This function handle OFF/HEAT/AUTO/COOL according to Apple specifications.

Depending of the value, the plugin will send an HTTP request to apiRoute + action where action is defined bu this piece of code:

			switch(value) {
				case Characteristic.TargetHeatingCoolingState.OFF:
				action = "/off";
				break;

				case Characteristic.TargetHeatingCoolingState.HEAT:
				action = "/comfort";
				break;
				
				case Characteristic.TargetHeatingCoolingState.AUTO:
				action = "/auto";
				break;
				
				case Characteristic.TargetHeatingCoolingState.COOL:
				action = "/no-frost";
				break;

				default:
				action = "/no-frost";
				this.log("Not handled case:", value);
				break;
			}

In your case, this will call something like http://host/auto. Please have a quick look to the implementation the code is supposed to be explicit enough. If not, I'll answer ;)

Best,

from homebridge-thermostat.

paulkoene avatar paulkoene commented on September 9, 2024

Cheers! I see the targetstate coming in now. For some reason it is not handling the returned information from the http://host/status. homekit "forgets" the targetstate after refreshing. Am I doing something wrong? The output is as follows...

{
"targetState": "HEAT",
"targetStateCode": 1,
"targetTemperature": 21,
"targetHeatingCoolingState": 3,
"currentHeatingCoolingState": 0,
"temperature": 22.3,
"humidity": 42.1,
"pressure": 104395
}

from homebridge-thermostat.

PJCzx avatar PJCzx commented on September 9, 2024

currentHeatingCoolingState can have only 3 values : HEAT/COOL/OFF. iOS Home app will call the getCurrentHeatingCoolingState and will display the result with the response of /status.

You want the system to handle the temperature automatically and the system chose to stay OFF. This is the case when the targetTemperature > currentTemperature but it's seems not to be the case.

Every single time you will open the iOS Home app, it will ask again to /status.

Please check the logic from the thermostat side cause I would expect the currentHeatingCoolingState to be heating (1) when the targetTemperature > currentTemperature.

Best,

from homebridge-thermostat.

paulkoene avatar paulkoene commented on September 9, 2024

In my view the logic is as follows. With homekit (or by other means) you set targetHeatingCoolingState to off, cool, heat or auto. You also set a targetTemperature. Depending on the targetHeatingCoolingState and the targetTemperature the currentHeatingCoolingState will be set. In this case the mode is auto with a target of 21 degrees. As the current temperature is 22.3 degrees the heating stays off. Theoretically it should actually go to a currentHeatingCoolingState of cooling, but I don't have an airconditioner hooked up :)

from homebridge-thermostat.

paulkoene avatar paulkoene commented on September 9, 2024

The problem is that the targetHeatingCoolingState is not getting back to homekit so it switches from auto to off after a refresh from http://host/status

from homebridge-thermostat.

PJCzx avatar PJCzx commented on September 9, 2024

Thx for this feedback, 2 things >

  1. For I don't know what reason, 2 lines were uncommented leading to loop call.
  2. The API/status targetStateCode need to be updated to targetHeatingCoolingState. You can update this in you /status feedback but I just pushed a workaround for it to work without changes from API side.

This will be better now ;)

from homebridge-thermostat.

PJCzx avatar PJCzx commented on September 9, 2024

PS: I updated npm if reeded :)

from homebridge-thermostat.

PJCzx avatar PJCzx commented on September 9, 2024

I may update currentHumidity and targetHumidity in the same occasion, but not now (unfortunatelly not enought time to dedicate)

from homebridge-thermostat.

paulkoene avatar paulkoene commented on September 9, 2024

Cool, it works now! Thanks!

from homebridge-thermostat.

PJCzx avatar PJCzx commented on September 9, 2024

I updated the code and the readme for an API the closest possible from HAP convention. this clarify some situations.

BTW, did you saw my repo Acova? It's an heating system brand I handle with a couple of electronic component. Maybe the code base could help you? At least the API (which do more than needed...)

Best ;)

from homebridge-thermostat.

paulkoene avatar paulkoene commented on September 9, 2024

Looks nice. You are doing things there that I am going to let homekits automation handle. My heating is a simple one that only understands on or off which I am steering with a relay based on the settings I am making with your plugin. The relay is interfaced with an Onion Omega + power dock + relay expansion which is similar to a raspberry pi solution. The temperature is coming from a wireless riot air sensor.

from homebridge-thermostat.

paulkoene avatar paulkoene commented on September 9, 2024

The heating system is actually due for a replacement so I will in time replace it with one that understands opentherm so I can control it better :)

from homebridge-thermostat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.