Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thermostat Sensor example #35

Open
HomeACcessoryKid opened this issue Nov 25, 2017 · 3 comments
Open

Thermostat Sensor example #35

HomeACcessoryKid opened this issue Nov 25, 2017 · 3 comments

Comments

@HomeACcessoryKid
Copy link
Owner

CLONED from API repository to demo repository, please stick to the format?
@faronov commented
Hi
I'm very interesting about this project, it looks very promise.
I'm not a developer guru, but can read and modify some code :)
I'm looking how to write thermostat code, I understand how to read temperature sensor
But can't understand how to store HEATING_THRESHOLD_TEMPERATURE_C
and where it can be stored

Also in your demo, I see how to get state from a sensor when it requested,
but how to get state continuously?
Like get the temperature from a sensor, compare with stored HEATING_THRESHOLD_TEMPERATURE_C and turn on or off relay when it needed, without interacting with homekit?
👍 1
@ageorgios

@ageorgios commented
I cannot answer your question, but on which hardware you are trying to implement the thermostat? Sonoff?
@faronov

@faronov commented
It can be Sonoff
but I have some devices with esp12 or esp7 modules
I made ESPurna-H board
http://tinkerman.cat/the-espurna-board-a-smart-wall-switch-with-power-monitoring/

P.S.
I also interesting to add power usage monitoring but it seems to look like power usage not supported homekit directly.
Only in custom profile with Elgato EVE application.
But this is another story :)

@HomeACcessoryKid
Copy link
Owner Author

initial but not complete answer:
The values that Homekit characteristics are live inside the json structure.
You can use json calls to interact with them, like compare measurement with setting.
The AiLight recently added might be more revealing in this respect.

As for how to make an actual thermostat?
Make a task that compares the setting with the measurement, vTaskDelay 1 second and repeat forever. Similar to the 15 second timer of the demo led switching on and off.

Hope this helped,
HacK

@faronov
Copy link

faronov commented Nov 27, 2017

Thanks for pointing to vTaskDelay I'm thinking about use it

About json calls, if I think correctly this is must be live call?
My point it what will happen when wifi is not available for some reason?
When all infrastructure is not available (after power drop, or other failures)

As it heating device it must work autonomously much as possible
and after a power failure, it must know what desire temperature is set before and compare with stored settings,
And after infrastructure is restored, get it from json calls again.
I think about stored this setting in somewhere locally, and ask where this locally is maybe been?

@HomeACcessoryKid
Copy link
Owner Author

HomeACcessoryKid commented Nov 27, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants