logo elektroda
logo elektroda
X
logo elektroda

[Solved] Integration of Sonoff detectors with air conditioning - how to construct?

unky 3537 16
Best answers

Can I use Sonoff window sensors to turn off an air conditioner contactor when a window is opened?

Yes, you can build it, but the thread recommends not cutting the air conditioner’s power directly; instead, use the window sensor to trigger an off command or a control circuit for the A/C [#18504876][#18507312] A simple Sonoff-based setup mentioned is a Sonoff DW1 window sensor plus a Sonoff Bridge on the same 2.4 GHz network, with an eWeLink scenario that switches off a suitably rated contactor when the window opens [#18504876] A more robust approach is to integrate everything in Home Assistant or OpenHAB and control the air conditioner by IR, e.g. with a Broadlink RM MINI3, rather than interrupting mains power [#18506333][#18507312][#18516984] The thread also suggests checking A/C status with current measurement, so the automation can verify whether the unit is actually running after sending the off command [#18507312][#18516984] In the final setup, the author chose Home Assistant with window sensors, an AC Freedom integration for the air conditioner, and a Shelly 1PM for energy monitoring, with Broadlink RM Mini 3 as a fallback [#18516984]
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18495127
    unky
    Level 18  
    Posts: 982
    Help: 1
    Rate: 61
    I would like to install Sonoff window sensors in the windows and a Sonoff contactor to which the air-conditioning is connected.
    When any window is opened, the contactor should be disconnected and the air-conditioning switched off.
    Is it possible to build something like this based on Sonoff?
  • ADVERTISEMENT
  • #3 18504876
    sk1977
    IT specialist
    Posts: 8047
    Help: 1326
    Rate: 741
    What you described can be done - the opening sensor can switch off the contactor (switch).
    Switch (suitable for the power of the air-conditioner) + Sonoff DW1 sensor + Sonoff Bridge connected to the same 2.4GHz network, with internet access cloud operation - if you want to do it on the eWelink app as a scenario.
    However, such a solution has a weakness: the information from the sensor will only relate to the opening of the window - it will not turn on the air conditioning when the window is closed. The need to use the Sonoff Bridge complicates and increases costs.

    There are also opening sensors that do not require a gate that reacts to opening or closing and gives the status, e.g. the Sonoff open/close sensor (I could not find information on the model and did not have the opportunity to learn more about it) - more expensive, but does not require a Bridge. Simplifies installation and configuration.

    If you have the ability to control the climate control by other means - e.g. IR, RF - this can be used.

    You can also use a system other than Sonoff or integrate systems - the possibilities are many.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #4 18506333
    unky
    Level 18  
    Posts: 982
    Help: 1
    Rate: 61
    I'm going to do it all on OpenHAB. I've done a bit of reading, even set up a server already and had a preliminary play around. A combo when it comes to smart home - there is a lot to learn but no cloud etc required.
    I will use an IR transmitter - Broadlink RM MINI3 - to operate the air conditioning. Perhaps additionally an on/off switch but I am advised against turning off the air conditioning by cutting the power.
    Now I'm looking for cool open-close sensors which I'll connect to OpenHAB and which will signal opening and closing and will respond to a query about the current status (just in case it cuts off the power if the window is open). In addition, I would like a contactor whose status can be checked and information if the contactor is loaded in order to check if the air-conditioning is working (in case someone "manually" turns it on).
    I will configure rules on OpenHAB and hopefully it will work nicely. The only concern I have is with the remote from the air-conditioner so that it can be replaced by this IR transmitter, but I will test this in battle.
    I want to put OpenHAB on a miniPC - Intel Nuc BOXNUC5CPYH - installation on Debian.

    By the way, I've done a bit of searching on the internet in the last few days on the subject of smart home and there's a whole bunch of these systems - Supla, Domoticz, eWelink, Somfy, Fibaro, Xiomi Smarthome etc. - normally a headache.
    Well, fortunately, I came across OpenHAB, which is supposed to tie everything together - it is supposedly the most difficult to set up but has support for many different devices of the above systems. After initial tests and trials it looks mega promising.
  • #5 18506436
    sk1977
    IT specialist
    Posts: 8047
    Help: 1326
    Rate: 741
    A good example of how delving into the subject of SmartHome works - it started with "wants to switch on one device" and in a few days already the server and system :) .

    See also Home Assistant + Node-RED - can be put on e.g. Rasberry PI - https://www.home-assistant.io/ - can be integrated into over 1500 systems, not bad support, fairly easy to use, constantly developed.

    unky wrote:
    Now I'm looking for cool lock opening sensors
    - see if you integrate: https://allegro.pl/oferta/czujnik-otwarcia-zamkniecia-wifi-ewelink-sonoff-8882278321
    I haven't had a chance to experience this device in person yet, but it looks promising. Or something from Xiaomi.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #6 18506477
    unky
    Level 18  
    Posts: 982
    Help: 1
    Rate: 61
    sk1977 wrote:
    Good example of how delving into the topic of SmartHome works - started with "wants to switch on one device" and in a few days already server and system :) .
    .
    Right :) I have been drawn into this home automation:) .

    sk1977 wrote:
    -see if you integrate: https://allegro.pl/oferta/czujnik-otwarcia-zamkniecia-wifi-ewelink-sonoff-8882278321
    I haven't had a chance to experience this device in person yet, but it looks promising. Or something from Xiaomi.
    .
    You have to change the firmware on the Sonoff I think - from what I've read - it connects to eweLink and that's not an open solution. Xiomi would also be OK - it is easy to integrate but you need a gateway for this because it does not work over WiFi.

    sk1977 wrote:
    See also Home Assistant + Node-RED - can be installed e.g. on Rasberry PI - https://www.home-assistant.io/ - can be integrated into more than 1500 systems, good support, fairly easy to use, constantly developed.
    .
    I'll have to have a read - looks interesting too.

    Added after 8 [minutes]:

    sk1977 wrote:
    See still Home Assistant + Node-RED - can be put on e.g. Rasberry PI - https://www.home-assistant.io/ - can be integrated into more than 1500 systems, not bad support, reasonably easy to use, constantly developed.
    .

    Well, you've made my mind cloudy. I was already decided on OpenHAB and here's the conundrum with this Home Assistant which looks really mega interesting :) .
    Now I don't know which way to go.... ;-)
  • #7 18506534
    sk1977
    IT specialist
    Posts: 8047
    Help: 1326
    Rate: 741
    If you absolutely want to operate without the cloud, the sonoff can be reprogrammed (I don't know if this one is too) - or you can use another sensor that can operate without the cloud.

    If you get a bit more involved, you will probably start using the cloud as well - it is worth going for solutions that can work with, for example, Google Home (you can use the voice assistant) and Amazon Alexa.
    In the case of Home Assistant, you can use it simultaneously with the cloud.
    Helpful post? Buy me a coffee.
  • #8 18506610
    unky
    Level 18  
    Posts: 982
    Help: 1
    Rate: 61
    sk1977 wrote:
    If you absolutely want operation without the cloud, the sonoff can be reprogrammed (I don't know if this one is too) - or you can use another sensor that can operate without the cloud.

    If you get a bit more involved, you'll probably start using the cloud too - it's worth going for solutions that can work with, for example, Google Home (you can use the voice assistant) and Amazon Alexa.
    In the case of Home Assistant, it can be used simultaneously with the cloud.


    I take it you have converted Home Assistant as well as OpenHAB or mainly Home Assistant though?
    ps. It's a bit tricky to install HomeAssistant on NUC and Debian. OpenHAB definitely simpler in terms of installation:) .
  • #9 18506640
    sk1977
    IT specialist
    Posts: 8047
    Help: 1326
    Rate: 741
    I haven't redone OpenHAB - so I don't have a comparison.
    Installing HA can be easy - Rasberry Pi and hassio - there are ready-made images. It's not difficult on debian either.
    Helpful post? Buy me a coffee.
  • #10 18506701
    kood
    CCTV and Stationary Alarms specialist
    Posts: 1896
    Help: 259
    Rate: 443
    Check if you can cut off the power from the air conditioner, from what I remember from one facility of this type of system, turning off the power in one splice resulted in the air conditioner stopping working in the neighbouring rooms and you had to make a circuit that simulates pressing the splice off button rather than cutting off the power from it.
  • ADVERTISEMENT
  • #11 18507312
    sk1977
    IT specialist
    Posts: 8047
    Help: 1326
    Rate: 741
    unky wrote:
    To operate the air conditioning I will use an IR transmitter - Broadlink RM MINI3
    - the concept of cutting the power has already fallen through.

    Depending on the air-conditioner, you may want to think about low-voltage switches - e.g. Sonoff SV (or similar) and their integration into the air-conditioner (e.g. button simulation).

    It is also worth doing a status verification - you can use a circuit breaker with current measurement (without using the shutdown or as an alternative) and check if the air conditioner has been correctly switched off based on the current drawn.

    E.g. open a window -> 1. check if the air conditioner is running (current drawn) -> 2. if yes: send IR off code -> 3. wait x sec. -> 4. check if the air conditioner is working (current drawn) -> if no: back to 2.
    It is also possible to add a protection in case of switching on with the window open
    1. detect switch on (current drawn) -> 2. check window -> 3. if open send IR off code -> 4. wait x sec. -> 5. check if the air conditioner is working (current drawn) -> if yes: back to 3.

    The switch itself with the current measurement can be used to block the air-conditioner from switching on (e.g. based on temperature, time, departure, etc. - whatever you can think of) preferably also based on the principle of safe shutdown 1. send shutdown code -> 2. wait x sec. ->check current -> if clique in STB you can switch off power, if not go back to 1.

    Current (value) and time x to be checked experimentally.
    Helpful post? Buy me a coffee.
  • #12 18512349
    xury
    Automation specialist
    Posts: 7071
    Help: 876
    Rate: 1486
    As already mentioned it is possible to integrate almost anything with HA and Node Red. In addition, popular modules based on ESP 8266, Xiaomi sensors and you can work wonders. For example, the Nora add-on is available in NodeRed and with it you can control practically everything by voice via Google home. You can make yourself all sorts of gateways or IR transmitters on the ESP8266.
    Nowadays, you can say "Give me any device and I will integrate it".
    When it comes to HA it is best to install as a whole hassio. There are ready-made images on Rpi, but you can also install via Docker
  • #13 18512976
    unky
    Level 18  
    Posts: 982
    Help: 1
    Rate: 61
    I was initially thinking of OpenHAB but the more I read the more I get drawn into Home Assistant. The only thing that doesn't convince me is installing on a Raspberry. I've already purchased an Intel NUC with SSD and would like to install on Debian but that seems a bit breakneck to me because HA generally instslated on Rpi.
  • #14 18512988
    sk1977
    IT specialist
    Posts: 8047
    Help: 1326
    Rate: 741
    unky wrote:
    HA generally instslated on Rpi
    - can also be installed on other devices - in Docker.
    Watch the videos. Once you have Debian, you use commands to install HA.
    Helpful post? Buy me a coffee.
  • #15 18512997
    unky
    Level 18  
    Posts: 982
    Help: 1
    Rate: 61
    I just don't quite get the idea of Docker. I've known Debian for years but just at the utility layer without going too in-depth, and I've never heard of anything like Docker - the term first occurred to me when installing HA on Debian.
  • #16 18513452
    xury
    Automation specialist
    Posts: 7071
    Help: 876
    Rate: 1486
    Here you go. This is how you install hassio in the docker container on intel nuc
    Code: Bash
    Log in, to see the code
    .

    For more info see: https://github.com/home-assistant/hassio-installer

    First of course you need to install docker on debian

    In short, Docker is a kind of virtualisation. It allows you to install systems in so-called containers, which do not interfere with your main system.
  • #17 18516984
    unky
    Level 18  
    Posts: 982
    Help: 1
    Rate: 61
    The topic can be closed.
    Conclusion:
    I have tested both OpenHAB and HomeAssistant and by far the number one is HomeAssistant. Mass of plugins, huge community making plugins for smart-home devices. I had no idea that this area is so advanced and that there is such a huge community integrating all kinds of devices working with HomeAssistant.
    It turned out that there is a plug-in for HA that makes it possible to replace the air conditioning control application (Sevra air conditioning with WiFi module) - the ACFreedom app - which enables direct control of the air conditioning. I will install the plug-in with HA and it will hopefully work. Plus Xiomi window opening sensors, I'll write some rules and hopefully it will work as expected. In addition, I will install a Selly 1PM WiFi contactor, which will enable me to measure the energy consumed by the air-conditioning so that I can calculate the profitability of the air-conditioning in the rental flat.

    If it turns out that the plug-in replacing the AC Freedom app doesn't work as expected, I'll use the Shelly 1PM contactor I mentioned above and control the air conditioning via the Broadlink RM Mini 3 IR remote control. A few rules to enter into HA and it should work.

    Thanks to everyone for their help :-) .

Topic summary

✨ The discussion revolves around integrating Sonoff window sensors and a contactor to control air conditioning systems. Users explore the feasibility of disconnecting the air conditioning when a window is opened, using Sonoff devices. Solutions include using a Sonoff DW1 sensor, a Sonoff Bridge for cloud operation, and alternatives like low-voltage switches or IR transmitters (e.g., Broadlink RM MINI3) for controlling the air conditioning. Concerns are raised about cutting power to the air conditioning, with suggestions for using current measurement to verify operation status. The conversation also highlights the choice between home automation platforms, primarily OpenHAB and Home Assistant, with a preference emerging for Home Assistant due to its extensive plugin support and community resources. The final solution involves using Xiaomi window sensors and a Selly 1PM WiFi contactor for energy monitoring.
Generated by the language model.

FAQ

TL;DR: Yes—you can link Sonoff/Xiaomi window sensors to AC via Home Assistant. It integrates over 1,500 systems and is "constantly developed". For DIYers automating AC via window sensors, use automations to stop cooling when windows open. [Elektroda, sk1977, post #18506436]

Why it matters: It reduces wasted energy and keeps AC control reliable when windows are open.

Quick Facts

Can I integrate Sonoff window sensors to automatically switch off my air conditioner?

Yes. Use a window opening sensor to trigger an automation that disables cooling. With Sonoff DW1, pair it to a Sonoff RF Bridge. Or choose a Wi‑Fi open/close sensor that reports state directly. Both work with rule‑based automations. [Elektroda, sk1977, post #18504876]

Is it safe to cut power to an air conditioner with a contactor when a window opens?

Cutting mains power can backfire. One site saw a split AC lose power, which also stopped neighboring rooms. The fix used a low‑voltage circuit that simulated pressing the OFF button instead. This approach avoids abrupt power loss. Confirm your model’s behavior first. [Elektroda, kood, post #18506701]

What’s the recommended way to shut down the AC when a window opens?

Send a proper OFF command and verify it. Use IR or a low‑voltage input to simulate OFF. Then confirm by checking current draw. How-To:
  1. Detect window open and check if the AC draws current.
  2. Send OFF, wait a few seconds.
  3. Re‑check; repeat if current remains. [Elektroda, sk1977, post #18507312]

Which open/close sensors work without a Sonoff RF Bridge?

Pick a Wi‑Fi open/close sensor from Sonoff that reports open and close directly. It costs more than RF units but avoids an RF Bridge. That simplifies installation and reduces latency. Alternatively, use DW1 with the Sonoff RF Bridge. [Elektroda, sk1977, post #18504876]

Will Xiaomi window sensors work with Home Assistant over Wi‑Fi?

Xiaomi sensors integrate well, but they don’t speak Wi‑Fi directly. They require a Xiaomi gateway for connectivity. After pairing, Home Assistant can consume their states through the gateway. Many users choose them for reliability. Plan for the extra hub in your design. [Elektroda, unky, post #18506477]

How many systems does Home Assistant integrate with?

Home Assistant integrates with over 1,500 systems. The platform has strong community support and is “constantly developed.” This breadth makes cross‑brand automations straightforward. You can connect sensors, IR blasters, and relays under one UI. It suits complex smart‑home builds. [Elektroda, sk1977, post #18506436]

Can I run Home Assistant on an Intel NUC with Debian?

Yes. Install Docker on Debian, then deploy Home Assistant in a supervised container. Use the installer script with the intel‑nuc machine flag. Docker keeps HA isolated from the host OS. This setup runs well on an Intel NUC. [Elektroda, xury, post #18513452]

Is OpenHAB still a good choice here?

Both platforms work, but the thread’s outcome favored Home Assistant. The author cited a “Mass of plugins” and a very active community. They tested OpenHAB and HA, then chose HA for this use. Either will integrate sensors and AC control. [Elektroda, unky, post #18516984]

Do Sonoff devices work without the cloud?

Yes. You can reprogram many Sonoff devices to run locally without eWeLink. Alternatively, choose sensors that operate without cloud dependencies. Home Assistant can still use cloud services in parallel. Pick the approach that fits your privacy goals. [Elektroda, sk1977, post #18506534]

Can I add voice control with Google Home?

Yes. Use Home Assistant with Node‑RED and the Nora add‑on. Nora exposes your entities to Google Home for voice control. ESP8266 devices and Xiaomi sensors also integrate smoothly. “You can work wonders” with this stack. [Elektroda, xury, post #18512349]

How can I verify the AC state and prevent manual overrides?

Add a smart switch with current measurement, such as Shelly 1PM. Use automation to detect current draw as the AC state. If a window is open and current rises, send OFF and re‑check. Loop until current falls to standby. [Elektroda, sk1977, post #18507312]

Which IR blaster works well for AC control?

Broadlink RM Mini 3 is a proven IR transmitter for AC control. Pair it with Home Assistant to send OFF and mode commands. It can replace the original remote for automations. Test codes during setup to confirm reliability. [Elektroda, unky, post #18506333]

Do I still need an IR blaster if my AC has Wi‑Fi?

Not always. For Sevra units, a Home Assistant plug‑in can replace the ACFreedom app for direct control. If that fails, fall back to Broadlink IR. Add Shelly 1PM to monitor power and verify success. This hybrid plan works well. [Elektroda, unky, post #18516984]
Generated by the language model.
ADVERTISEMENT