Code Monkey home page Code Monkey logo

orconwificontroller's Introduction

The OrconWifiController is used to control an Orcon "Mechanische Ventilatie" unit through Wi-Fi. Integrating it Home Assistant, it provides the following functions:

  • Read the requested speed from the remote or built-in humidity sensor. [pulselength in seconds]
    • It reads the PWM signal which is sent from the factory controller to the fan. So it does not read the actual level (level 1, 2 (humidity sensor) or 3) but you can deduce the current level from the pulselength
  • Read the current fanspeed [revolutions / minute]
  • Control the fanspeed using a PWM signal
  • Switch between factory control or Home Assistant control [on/off]
  • Optionally, when you have a 5v BME280 sensor installed, you can read temperature, humidity and air pressure from the ventilated air.

The OrconWifiController built into an Orcon MVS-15 unit: Graphs The OrconWifiController is compatible with all Orcon MVS-15 units, as long as they are based on the EBM-Papst R3G190-RC05-20 fan. The OrconWifiController is also suitable for the Orcon Compact 10-RHB; the case needs to be adjusted a bit to make it fit.

The above functionality is accomplished by installing the OWC in between the fan and factory controller. The OWC is controlled by an ESP (Wemos D1 Mini (Pro)) and runs ESPHome firmware. A 220V cable is supplied. All the 220V connectors have the same pinout, so they can be connected in any way possible. It is also possible to run the OWC standalone, without the factory PCB.

It is also possible to run Tasmota firmware, but the current speed of the fan will not be working. It is still possible to control the speed of the fan, and to turn the relay on and off. But the current speed (huidige toerental) does not work.

A relay controls if the factory PCB controls the fan, or that the Wemos controls the fan. The default state of the relay is that the factory remote is in control. If you want to control the speed of the fan through Home Assistant/Wemos then the relay must be activated.

On the PCB, the following pins are connected:
Top-left = 1
Bottom-left = 8
Top right = 9
Bottom-right = 16

Version 1.2
Pin 5 = PWM output to fan
Pin 7 = Relay
Pin 11 = Input from factory PCB (PWM)
Pin 12 = Current fanspeed rpm

Version 1.3 and 1.4
Pin 5 = PWM output to fan
Pin 7 = Relay
Pin 4 = Current fanspeed rpm
Pin 6 = Input from factory PCB (PWM)
Pin 11 = SCL for temperature/humidity
Pin 12 = SDA for temperature/humidity

The rest of the pins are designed for a Wemos D1 Mini (Pro).

Steps to integrate it into Home Assistant with the default configuration:

  • Do not install it in the MV unit yet.
  • Connect the OrconWifiController with USB cable to laptop/computer.
  • Make sure the Wemos is still installed onto the OrconWifiController.
  • After a minute a Wifi hotspot called OrconWifiController will be created. Connect to it using password 12341234.
  • Use your phone in case it is not visible on your computer/laptop.
  • If there is no popup to automatically configure the Wifi, go to 192.168.4.1 in your browser.
  • Enter the credentials of your WiFi network and click save.
  • Add the ESPHome addon in Home Assistant (I don't know if this is necessary but I don't have a way to test this. I list it here just to be sure).
  • In Home Assistant, go to Configuration --> Integrations --> Add integration --> ESPHome.
  • Enter the hostname (mvtest13.local) or IP address of the OrconWifiController and click submit.
    • Using a hostname will be more flexible, but can take some time before it is found by Home Assistant.
    • If you use a IP address, the connection will work immediately, but make sure that your router/accesspoint will not change the IP address of the OrconWifiController, or otherwise Home Assistant will loose connection to it.
  • The new sensors/controls should be setup automatically by HA.
  • If not, add the sensors/controls in Lovelace manually.
  • Test the sensors/controls. The relay should work. If you have the optional BME280 temp/humid sensor, this should work as well, but only if it is connected before poweron.
  • Install the OrconWifiController in the MV unit and start creating automations :)
  • If you want to change anything, follow the steps below.

Steps to integrate it into Home Assistant with your own configuration (recommended):

  • Do not install it in the MV unit yet.
  • Add the ESPHome addon in Home Assistant.
  • Create a node in ESPHome. The name you enter here will be the hostname and must reflect the "name" in the YAML.
  • Enter your Wifi credentials.
  • Pick a specific board --> Wemos D1 and Wemos D1 mini.
  • On the Github page, find the YAML code (https://github.com/hubertjanhickinson/OrconWifiController/blob/main/Wemos%201.3 is the same as version 1.4) for the corresponding version of your OrconWifiController.
  • Copy and paste the YAML code into the node.
  • Change the "name" field back to your "name" in one of the previous steps.
  • Change the Wifi credentials to match your Wifi network.
  • Make your changes to the YAML. For example, delete the BME280 sensor if you don't have it installed.
  • Click Install.
  • Click Manual download (or use the builtin option to flash through Google Chrome but I have not tested that).
  • Let it compile and save the .bin firmware file somewhere on your laptop/computer.
  • Uninstall the Wemos from the OrconWifiController and connect it through a USB cable to your laptop/computer.
  • Download a ESP flash tool (Tasmotizer or ESPEasyflasher) and flash the firmware to the Wemos.
  • Install the Wemos back to the OrconWifiController and connect it with a USB cable.
  • It will connect to your Wifi network and in ESPHome you should see the node as online.
  • In Home Assistant, go to Configuration --> Integrations --> Add integration --> ESPHome.
  • Enter the hostname (the name you entered earlier) or IP address of the OrconWifiController and click submit.
  • The new sensors/controls should be setup automatically by HA.
  • If not, add the sensors/controls in Lovelace manually.
  • Test the sensors/controls. The relay should work. If you have the optional BME280 temp/humid sensor, this should work as well, but only if it is connected before poweron.
  • Install the OrconWifiController in the MV unit and start creating automations :)

Troubleshooting:

  • Connect a USB cable to the OrconWifiController and use Putty with a baudrate of 115200 to see debug information.
  • Install the Terminal addon in Home Assistant and try to ping the hostname. It will respond with the IP address shown.
  • Check your router/accesspoint to see which IP address is given to the OrconWifiController. The MAC address wil start with E8:DB:84.

Selling/buying the OrconWifiController\ You can buy the OrconWifiController at https://www.tindie.com/products/hjhickinson/orconwificontroller/



Example of data in Grafana: Graphs

Example of Home Assistant Lovelace interface: HA Interface

Check out this template as well: https://gist.github.com/Kalkran/d924a0ada197fa1c68df3708eae4ce86

orconwificontroller's People

Contributors

hubertjanhickinson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

orconwificontroller's Issues

[E][bme280.sensor:146]: Communication with BME280 failed!

After configuring the OrconWifiController and using the default configuration there is an error in the log. Afterwards the defined sensors humidity, pressure and temperature are non-functional. The board edition is version 1.3.

With the following error: [18:45:14][E][bme280.sensor:146]: Communication with BME280 failed!

INFO Reading configuration /config/esphome/mvtest13.yaml...
INFO Starting log output from mvtest13.local using esphome API
INFO Connecting to mvtest13.local:6053 (192.168.20.160)
INFO Successfully connected to mvtest13.local
[18:45:13][I][app:105]: ESPHome version 1.18.0 compiled on Jun 9 2021, 18:39:24
[18:45:13][C][wifi:443]: WiFi:
[18:45:13][C][wifi:303]: SSID: [redacted]
[18:45:13][C][wifi:304]: IP Address: 192.168.20.160
[18:45:13][C][wifi:306]: BSSID: [redacted]
[18:45:13][C][wifi:307]: Hostname: 'mvtest13'
[18:45:13][C][wifi:311]: Signal strength: -64 dB ▂▄▆█
[18:45:13][C][wifi:315]: Channel: 11
[18:45:13][C][wifi:316]: Subnet: 255.255.255.0
[18:45:13][C][wifi:317]: Gateway: 192.168.20.1
[18:45:13][C][wifi:318]: DNS1: 1.1.1.1
[18:45:13][C][wifi:319]: DNS2: 8.8.8.8
[18:45:13][C][i2c:028]: I2C Bus:
[18:45:13][C][i2c:029]: SDA Pin: GPIO4
[18:45:13][C][i2c:030]: SCL Pin: GPIO5
[18:45:13][C][i2c:031]: Frequency: 50000 Hz
[18:45:13][I][i2c:033]: Scanning i2c bus for active devices...
[18:45:13][I][i2c:049]: Found no i2c devices!
[18:45:14][C][esp8266_pwm:022]: ESP8266 PWM:
[18:45:14][C][esp8266_pwm:023]: Pin: GPIO12 (Mode: OUTPUT)
[18:45:14][C][esp8266_pwm:024]: Frequency: 1000.0 Hz
[18:45:14][C][esp8266_pwm:025]: Inverted: YES
[18:45:14][C][switch.gpio:042]: GPIO Switch 'mv_unit_speed_bypass_test'
[18:45:14][C][switch.gpio:043]: Pin: GPIO15 (Mode: OUTPUT)
[18:45:14][C][switch.gpio:059]: Restore Mode: Restore (Defaults to OFF)
[18:45:14][C][logger:189]: Logger:
[18:45:14][C][logger:190]: Level: DEBUG
[18:45:14][C][logger:191]: Log Baud Rate: 115200
[18:45:14][C][logger:192]: Hardware UART: UART0
[18:45:14][C][light:178]: Light 'mv_unit_speed_test'
[18:45:14][C][light:180]: Default Transition Length: 1.0s
[18:45:14][C][light:181]: Gamma Correct: 1.00
[18:45:14][C][pulse_counter:147]: Pulse Counter 'mv_tacho_test'
[18:45:14][C][pulse_counter:147]: Unit of Measurement: 'pulses/min'
[18:45:14][C][pulse_counter:147]: Accuracy Decimals: 0
[18:45:14][C][pulse_counter:147]: Icon: 'mdi:pulse'
[18:45:14][C][pulse_counter:148]: Pin: GPIO14 (Mode: INPUT)
[18:45:14][C][pulse_counter:149]: Rising Edge: INCREMENT
[18:45:14][C][pulse_counter:150]: Falling Edge: DISABLE
[18:45:14][C][pulse_counter:151]: Filtering pulses shorter than 250 µs
[18:45:14][C][pulse_counter:152]: Update Interval: 10.0s
[18:45:14][C][pulse_width:020]: Pulse Width 'mv_speed_requested_test'
[18:45:14][C][pulse_width:020]: Unit of Measurement: 's'
[18:45:14][C][pulse_width:020]: Accuracy Decimals: 8
[18:45:14][C][pulse_width:020]: Icon: 'mdi:timer-outline'
[18:45:14][C][pulse_width:021]: Update Interval: 10.0s
[18:45:14][C][pulse_width:022]: Pin: GPIO13 (Mode: INPUT)
[18:45:14][C][bme280.sensor:142]: BME280:
[18:45:14][C][bme280.sensor:143]: Address: 0x76
[18:45:14][E][bme280.sensor:146]: Communication with BME280 failed!
[18:45:14][C][bme280.sensor:155]: IIR Filter: OFF
[18:45:14][C][bme280.sensor:156]: Update Interval: 10.0s
[18:45:14][C][bme280.sensor:158]: Temperature 'OrconTemp'
[18:45:14][C][bme280.sensor:158]: Device Class: 'temperature'
[18:45:14][C][bme280.sensor:158]: Unit of Measurement: '°C'
[18:45:14][C][bme280.sensor:158]: Accuracy Decimals: 1
[18:45:14][C][bme280.sensor:159]: Oversampling: 16x
[18:45:14][C][bme280.sensor:160]: Pressure 'OrconPressure'
[18:45:14][C][bme280.sensor:160]: Device Class: 'pressure'
[18:45:14][C][bme280.sensor:160]: Unit of Measurement: 'hPa'
[18:45:14][C][bme280.sensor:160]: Accuracy Decimals: 1
[18:45:14][C][bme280.sensor:161]: Oversampling: 16x
[18:45:14][C][bme280.sensor:162]: Humidity 'OrconHumidity'
[18:45:14][C][bme280.sensor:162]: Device Class: 'humidity'
[18:45:14][C][bme280.sensor:162]: Unit of Measurement: '%'
[18:45:14][C][bme280.sensor:162]: Accuracy Decimals: 1
[18:45:14][C][bme280.sensor:163]: Oversampling: 16x
[18:45:14][C][captive_portal:169]: Captive Portal:
[18:45:14][C][ota:029]: Over-The-Air Updates:
[18:45:14][C][ota:030]: Address: mvtest13.local:8266
[18:45:14][C][api:095]: API Server:
[18:45:14][C][api:096]: Address: mvtest13.local:6053
[18:45:16][C][pulse_width:026]: 'mv_speed_requested_test' - Got pulse width 0.000 s
[18:45:16][D][sensor:099]: 'mv_speed_requested_test': Sending state 0.00005 s with 8 decimals of accuracy
[18:45:16][D][pulse_counter:159]: 'mv_tacho_test': Retrieved counter: 300.00 pulses/min
[18:45:16][D][sensor:099]: 'mv_tacho_test': Sending state 300.00000 pulses/min with 0 decimals of accuracy
[18:45:26][C][pulse_width:026]: 'mv_speed_requested_test' - Got pulse width 0.000 s
[18:45:26][D][sensor:099]: 'mv_speed_requested_test': Sending state 0.00005 s with 8 decimals of accuracy
[18:45:26][D][pulse_counter:159]: 'mv_tacho_test': Retrieved counter: 288.00 pulses/min
[18:45:26][D][sensor:099]: 'mv_tacho_test': Sending state 288.00000 pulses/min with 0 decimals of accuracy
[18:45:36][C][pulse_width:026]: 'mv_speed_requested_test' - Got pulse width 0.000 s
[18:45:36][D][sensor:099]: 'mv_speed_requested_test': Sending state 0.00005 s with 8 decimals of accuracy
[18:45:36][D][pulse_counter:159]: 'mv_tacho_test': Retrieved counter: 234.00 pulses/min
[18:45:36][D][sensor:099]: 'mv_tacho_test': Sending state 234.00000 pulses/min with 0 decimals of accuracy
[18:45:46][C][pulse_width:026]: 'mv_speed_requested_test' - Got pulse width 0.000 s
[18:45:46][D][sensor:099]: 'mv_speed_requested_test': Sending state 0.00005 s with 8 decimals of accuracy
[18:45:46][D][pulse_counter:159]: 'mv_tacho_test': Retrieved counter: 222.00 pulses/min
[18:45:46][D][sensor:099]: 'mv_tacho_test': Sending state 222.00000 pulses/min with 0 decimals of accuracy

ESPhome YAML (removed home SSID and passwords)
mvtest13.zip

Change .light to .fan

Code for changing the light.orcon_unit_speed entity from a light to a fan.
This code needs to be in your /homeassistant/configuration.yaml file.


fan:
  - platform: template
    fans:
      afzuiging_fan:
        friendly_name: "Mechanische ventilatie"
        value_template: "{{ states('light.orcon_unit_speed') }}"
        percentage_template: >
          {{ (state_attr('light.orcon_unit_speed', 'brightness') / 255 * 100) | int }}
        turn_on:
          service: homeassistant.turn_on
          entity_id: light.orcon_unit_speed
        turn_off:
          service: homeassistant.turn_off
          entity_id: light.orcon_unit_speed
        set_percentage:
          service: light.turn_on
          entity_id: light.orcon_unit_speed
          data_template:
            brightness: >
              {{ ( percentage / 100 * 255) | int }} 
        speed_count: 3   

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.