User Tools

Site Tools


openhab

OpenHAB

OpenHAB is a server for Home Automation tasks. It is written in Java and makes use of some OOB properties and syntax.

Rules are configured in one or more text files, “when change happens, then invoke the configuration block”

The goal here was in my East facing apartment, if the Sun is north of 110 degrees or if the TV is on, then close the blinds using the RFXCOM binding instead of the radio remote and the Omnia Go roller shade motor.

http://www.rfxcom.com/WebRoot/StoreNL2/Shops/78165469/MediaGallery/Downloads/RFXtrx_User_Guide.pdf

https://omniablinds.com

Rules

rule "Daylight Start Summer"
when
  Item astro_sun_local_phase_name changed to DAYLIGHT
then
  var int _azimuth = astro_sun_local_position_azimuth.getStateAs(QuantityType).toUnit('°').intValue
  if (_azimuth < 110) rfxcom_socket_Socket_1_0_2298B1K0117_state.sendCommand(ON)
end

rule "TV turned ON"
when
  Item network_pingdevice_tv_online changed to ON
then
  if (astro_sun_local_phase_name.state == "DAYLIGHT") rfxcom_socket_Socket_1_0_2298B1K0117_state.sendCommand(ON)
end

rule "Sun Moved or TV turned OFF"
when
  Item astro_sun_local_position_azimuth changed or
  Item network_pingdevice_tv_online changed to OFF
then
  var int _azimuth = astro_sun_local_position_azimuth.getStateAs(QuantityType).toUnit('°').intValue
  logInfo("Sun Moved", "Azimuth: {}", _azimuth)
  if (astro_sun_local_phase_name.state == "DAYLIGHT" && _azimuth > 110 && network_pingdevice_tv_online.state == OFF) rfxcom_socket_Socket_1_0_2298B1K0117_state.sendCommand(OFF)
end

rule "Daylight End"
when
  Item astro_sun_local_phase_name changed from DAYLIGHT
then
  rfxcom_socket_Socket_1_0_2298B1K0117_state.sendCommand(OFF)
end
openhab.txt · Last modified: 2020/02/13 22:55 (external edit)

free spam filter