Examples of HABPanel Solutions

(Kim Andersen) #476

I really wonder why it isn´t possible to turn on/off a screen directly through openhab using an item (not using the GPIO of the Rpi). What exactly is required to be able to do this?

(Hakan Tandogan) #477

I did this with my Samsung TVs, install the cec-utils:

sudo apt-get install cec-utils

then run

# Send power-on command to specified RPi
/bin/echo 'standby 0' | cec-client -s -d 1


# Send power-on command to specified RPi
/bin/echo 'standby 0' | cec-client -s -d 1

Wrapping those in a proper shell script and running them via the exec binding is an excercise left for the reader :grinning:

(Ole Kristian Lona) #478

Good question! I use the GPIO only for presence detection. The command I use to turn on / off the screen is “xset dpms force on” and “xset dpms force off”. So you just need a way to make your Openhab item send that command, based on state. My proposed approach will be to create an item that I will make available through MQTT. The machine where I need to turn the screen on and off (not the same machine where Openhab is running) will have a script running, which will subscribe to the events for this item, and turn off the screen when the item has been set to “off”. It will then wait for a few seconds before checking motion detection again, so the user has tome to “esace” in case the screen was turned off by pressing a button on the screen itself.

(Lucky) #479

I do mine differently. Same commands to turn on/off but the triggers are based on my cameras. If x minutes has passed without motion, the monitor turns off (Expire Binding), when motion occurs, monitor turns on. And via a Switch item I can enable/disable the rule like when we’re watching TV. The host pi has a python code to accept commands via HTTP

(Ole Kristian Lona) #480

Sounds cool! -And obviously, using HTTP or MQTT is just a matter of protocol, so that doesn’t matter that much :slight_smile:

(Ole Kristian Lona) #481

BTW, how do you detect motion from the cameras, and how do you send that information to Openhab? I don’t have a camera on my computer, so that would n’t be an option for me, I am just curious :slight_smile:

(Lucky) #482

I have a Blue Iris (BI) server that processes my cameras and detects motion. BI has both MQTT and REST API clients. When a motion is detected, it updates my OH with time stamp, and the camera that was triggered. Currently, I am working on an OpenVino based object detection using MyriadX. That way my entire camera system will become smarter and be able to classify objects such as human faces, cats, Amazon boxes, etc.

(Kristof Rado) #483

Looks really cool! I really want one, but I’m sad that I don’t have the space for a screen like this in the kitchen (where it also looks good).

However a different approach I would choose (and use in home automation):
Have any motion sensor which can be included in openHab (like a Z-Wave device or your alarm system which Zones can be integrated into OH, any kind…). That way automating things like the screen can be easily done. Place a sensor in the Kitchen and make some rules which will trigger an exec command to turn on the screen. That way you can easily change setoff value, make a rule to also turn off the screen when leaving the house, etc… Plus you can use that one sensor not just for the screen.

(Lucky) #484

Yup. I use a combination of cameras and Vista20P sensors

(Jonathan Genster) #485


how did you implement the “I paused my music to hear you”-Image when there cover image stated in the item? Is it possible with a rule? Don’t get how I change the item state with a new image instead of a string.


(Joe) #486

Just upgraded to Openhab 2. Thanks for the good ideas HabPanel ideas (definitely helped).

(Daniel) #487

Hi there! First off, many of these examples has helped me build my setup just the way I wanted it to be, thanks for that! So, the first post on the forum and I thought I’d share my setup.
It consists of two mounted tablets.

Nearly done configuring my home setup consisting of these features:

  • Prescense Detection
  • Notification via Google Home (sound & TTS)
  • Alarm (incl. timers and password locking the tablets)
    – As well as messaging and mailing when alarm is triggered.
  • Scenes for lighting (Bedroom/Livingroom)
  • Different timebased routines (Morning/Evening)
  • TV control w/ spotify control and playlist selection
  • Automatic restart of openhab/server/tablets as well as logging and ssh access.
  • Movie Scene (dim lighting when TV is playing)

Let me know what you think!

(Cyanide 4c) #488

@ joefm1218, nice one, how did you setup the Nest detectors?

(Ingo Jeromin) #489

Hey Jochen,

really good Work.

Could you share the Code for the Birthday-Box? I will implement such a thing.

Best wishes Ingo

(Joe) #490

Here’s the custom widget I created. You need to set 4 configuration parameters in your widget (smoke, co, battery and last):

<div ng-init="ServerPath='/static'"></div>

<table style="width: 100%; border-collapse: separate; border-spacing: 4px;">
    <td style="border: 2px solid #76899e; border-radius: 10px;">
      <table style="width: 100%;">
          <td rowspan="4" style="padding: 0px; padding-top: 0px; padding-bottom: 0px"><img id="nest-icon" height="80" width="80" src="{{ServerPath}}/images/nest-fire-co-01.png"/></td>
          <td style="padding-left: 10px; padding-right: 10px; padding-top: 0px; padding-bottom: 0px">Smoke:</td>
          <td style="padding-left: 10px; padding-right: 10px; padding-top: 0px; padding-bottom: 0px" ng-style="{ color: itemValue(config.smoke)=='OK' ? 'green' : 'red' }">{{itemValue(config.smoke)}}</td>
          <td style="padding-left: 10px; padding-right: 10px; padding-top: 0px; padding-bottom: 0px">CO:</td>
          <td style="padding-left: 10px; padding-right: 10px; padding-top: 0px; padding-bottom: 0px" ng-style="{ color: itemValue(config.co)=='OK' ? 'green' : 'red' }">{{itemValue(config.co)}}</td>
          <td style="padding-left: 10px; padding-right: 10px; padding-top: 0px; padding-bottom: 0px">Battery:</td>
          <td style="padding-left: 10px; padding-right: 10px; padding-top: 0px; padding-bottom: 0px"ng-style="{ color: itemValue(config.battery)=='OK' ? 'green' : 'red' }">{{itemValue(config.battery)}}</td>
          <td style="padding-left: 10px; padding-right: 10px; padding-top: 0px; padding-bottom: 0px">Last connection:</td>
          <td style="padding-left: 10px; padding-right: 10px; padding-top: 0px; padding-bottom: 0px; color: orange">{{itemValue(config.last) | date:'MM-dd-yyyy HH:mm'}}</td>


Here are the items file which includes 1 nest unit sample (I have many others units but just show 1 here):

String   Smoke_Basement_CO_Alarm            "CO Alarm [%s]"		{ channel="nest:smoke_detector:demo_account:smoke_basement:co_alarm_state" }
Switch   Smoke_Basement_Battery_Low         "Battery Low"		{ channel="nest:smoke_detector:demo_account:smoke_basement:low_battery" }
Switch   Smoke_Basement_Manual_Test         "Manual Test"		{ channel="nest:smoke_detector:demo_account:smoke_basement:manual_test_active" }
String   Smoke_Basement_Smoke_Alarm         "Smoke Alarm [%s]"	{ channel="nest:smoke_detector:demo_account:smoke_basement:smoke_alarm_state" }
String   Smoke_Basement_UI_Color            "UI Color [%s]"		{ channel="nest:smoke_detector:demo_account:smoke_basement:ui_color_state" }
DateTime Smoke_Basement_Last_Connection     "Last Connection [%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS]"    { channel="nest:smoke_detector:demo_account:smoke_basement:last_connection" }
DateTime Smoke_Basement_Last_Manual_Test    "Last Manual Test [%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS]"   { channel="nest:smoke_detector:demo_account:smoke_basement:last_manual_test_time" }

Here are the things file (showing only the basement unit):

Bridge nest:account:demo_account [ productId="<product id>", productSecret="<secret>",
accessToken="<token>" ] 
	Thing smoke_detector smoke_basement     "Smoke Basement"		[ deviceId="<device id>" ]

Obtaining product id, secret and token requires a development account on nest. Once you obtain this, you can use curl command to query for all your device id’s using your .

curl -v --location-trusted 
   -H "Content-Type: application/json" 
   -H "Authorization: Bearer <token>" 
   -X GET "https://developer-api.nest.com/"

(Cyanide 4c) #491

Cool, thx