My Story : Registered the 12/07/17:)

Glad to start writing my smart home story!

And really glad to share it with you Openhab community.

Your feedback and remarks are more than welcome!!!

Since more than 10 months (with less long nights), i moved to my new house. at the first sight, i prefered to pay instead of building a smart home by myself.

Quickly, I have understood that it will be expensive and limited.

it was an interesting journey, i learned a lot and i am really impressed by the professionalism of the community and more important than this : the willing to help, to share knowledge ( one of the best example is the excellent series of article on the Design pattern approach by Rich Koshak).

My first intention was to use broadlink devices which are cheap, good quality and do not need neutral line.

Without openhab just with the RM pro, i have controlled my AC, TV and some TC2 switches.

I have understood the limitations of the broadlink echo system:

  1. limited UI
  2. only available on android, no WEB UI
  3. No persistence. (really problematic for AC)
  4. no integration without something not from broadlink
  5. No voice command…

but a cheap and stable solution for IR and RF

To overcome to all the limitations, i came to the conclusion that i need a smart home server like openhab.

i have hesitated between homeassistant and openhab and i finally decided to go to openhab because there was an android application.,

my expected design was to to be able to get this integration

image

Indeed i am a fan of IFTTT.:). so simple and so strong!

i have started installing openhab on windows, it was not really fun.

i ordered my first raspberry ! i am still impressed by the power of this small thing!

Thanks to the excellent articles and movies of https://www.mksmarthouse.com/, i have got a good understanding and made some progress.

Sorry to be so “windows minded”, but i have installed openhab on debian. it’s always good to have UI.

On the second side, it took me a lot of time to install all the components provided with the openhabian image : MQTT, nodeRed, Taillog framework……

My initial broadlink hardware to integrate with Openhab:

  1. Broadlink S1.
    Integration done thanks to the amazing rednode
    image
  2. Broadlink SP1
    image
    integrated thank to this python service to communicate through mqttt https://github.com/psyciknz/broadlink-mqtt

More details in this post

  1. Broadlink TC2
    integrated thank to this python service to communicate through mqttt https://github.com/psyciknz/broadlink-mqtt

  2. Broadlink A1
    Integration done thanks to the amazing rednode
    image

  3. Broadlink M1
    image

integrated thank to this python service to communicate through mqttt https://github.com/psyciknz/broadlink-mqtt

BTW, This thread https://community.openhab.org/t/broadlink-binding-for-rmx-a1-spx-and-mp-any-interest was promising but the contributor has dissapeared:(

i really like broadlink but the switches are based on RF, the communication is one way only. => no possibility to know the current state.

i have decided to use also a mesh network . Z-wave is more standardized to zigbee and CHris Jackson has made an excellent job and an excellent maintenance.

My Z-wave hardware:

  1. Controller Z-Wave Plus Z-Stick GEN5 - Aeon Labs
    (i had some issue with the inclusion. i need to plug the stick to my laptop and to use the program Aeon Lab OTA to add/remove a node.)

  2. NEO Coolcam NAS-DS01Z Smart Home Z-Wave Plus Door Window Sensor Compatible with Z-wave 300 series and 500 series Home Automation
    image

  3. NEO Coolcam NAS-PD01Z Smart Home Z-Wave Plus PIR Motion Sensor Compatible with Z-wave 300 series and 500 series Home Automation
    image
    i am really satisfied from the neo devices stability but in as you can see for PIR motion sensor, the temperature is not retrieved.

  4. Fibaro Sensor
    image

Other Things to integrate:
Hardware :

  1. Chromecast : Simple to integrate with the chromecast binding
  2. Voice Kit AIY DIY
  3. Irobot
  4. Switcher (water boiler)

Services :

  1. IFTTT
  2. Google calendar : My home should have a calendar!
  3. Google assistant : i want to speak with my home!
  4. Telegram : i want to chat with my home!
  5. Google sheets : to keep motion or door sensor activity in a google sheets
  6. tts

IFTTT

Let’s speak about IFTTT, the integration is awesome from IFTTT to openhab.
image

From openhab to IFTTT, there’s a big delay.
When i want to trigger a IFTTT action from openhab, it’s definitely faster to use the IFTTT webmaker from a rule instead of using in the IF the openhab service.

image

a webhook call from a rule

			var String ifttt_key = "d--*****************************"
			var String notification_json
			val String currentTime = String::format( "%1$tl:%1$tM%1$tp on %1$tA, %1$tB %1$te, %1$tY", new java.util.Date )

			var lastItem = TriggerGlobalScene.previousState().state.toString
			var String ifttt_url = "https://maker.ifttt.com/trigger/"+TriggerGlobalScene.state.toString + "/with/key/" + ifttt_key
			var String TriggerStripped =TriggerGlobalScene.state.toString 
			TriggerStripped =TriggerStripped.replace('','_')

			notification_json = '{"value1":"' + lastItem + '","value2":"' +  TriggerStripped +'","value3":"' + currentTime + '"}'
			sendHttpPostRequest(ifttt_url, "application/json", notification_json,8000)	

i have exposed 4 items :

  1. voicecommand_input
  2. Calendar_input
  3. Telegram_input
  4. VoiceToSpeak_input

and a last one which is called “Scene”

All the items inputs trigger the scene Change.

Example: if the scene changes to bye, it will turn off everything.

With this implementation, i can trigger any scenes from Google Assistant, google calendar, and telegram…

  1. Send /IFTTT bye to a telegram group
  2. say to the google assistant $lili bye
  3. Add a meeting called bye

The “VoiceToSpeak_input” : a nice recipe!

Use the google assistant with a magic word and in case the magic word is found, it will update the VoiceToSpeak_input.

if the VoiceToSpeak_input, a rule will “say” the input.

you can speak remotely to your home through google assistant!.

I have still some issues with TTS.

Below you can find the recipe of each use case
Google assistant integration
image

Google calendar integration
image

Google sheets integration to Record activity or motion
image

To summarize: Google assistant integrated => BTW, the AIY DIY voice kit also covered since the same google account is used.

My integration map :

image

Let’s go over my sitemap:

1 Stable sitemap

a nice weather widget implemented in 2 sec
I love the web frame but it’s only available in web not from the android application

MyCalendar:
The google calendar of the home! another web UI framework
image

from this google calendar, i schedule irobot, Water boil, Bye scene, Turn on/Turn OFF AC

Map settings:
roles and permissions are missing in openhab
image

Settings sitemap
image

For example, the LP switch is the parental lock to turn on TV. if the kids are smart and they are ! they will found it :slight_smile:

all the integrations could be disabled from this section.

Pi monitoring thanks to the system info binding
image

Graph:

Thanks to InfluxDB persistence and Grafana, i have nice monitoring graph
image
and i have also some sensors graph
image

i have also a section debugging :
image

My model is cool but it could not work without internet and the IFTTT dependency is a must but it’s stable. Not sure to know/understand if there’s an IFTTT usage limit.

What i am missing:

  1. Roles and permissions
  2. Camera integration Y203
  3. A simple TTS configuration, i want that my home will speak.
    In case that the door is opened more than minutes or if a scenario is triggered.
    I didn’t succeed to get the AIY DIY google voice. if someone could guide me, i will appreciate.

i have also ordered a chromecast audio. i didn’t succeed to make speak through bluetooth speaker

  1. a solution for switch two ways without neutral line.
    i will test this model , did someone has some feedbacks?

5 a good solution to learn and send all the IR combinations of an air conditioner… more details here

6 Folks, do you see a point to setup a own openhab cloud instance? will it work with IFTTT?

Thanks for all your help

7 Likes

@rlkoshak thanks for your materials! and explanations.

@chris thanks for your work on Z-wave

I’d like to see more details about how you set this up. In particular, are the screen shots you are showing from IFTTT or from Google Assistant?

I do think that some if not all of this could be done without IFTTT. But if you are happy with the performance I see no reason to change.

This is a significant lack in OH. You can get part of the way there by controlling access to your sitemap using a reverse proxy.

There is an IP Camera binding on the IoT Marketplace. I think the ZoneMinder Binding is now officially available. Shinobi is another alternative that I’m going to look into some day. If you just want to show the stream on your sitemap there is the Video element. It doesn’t work in the phone app when you are not on your LAN though, just like the webviews.

Here is my WIP. [WIP] Google AIY Voice with openHAB Skip down to the MQTT Announcements section for how I implemented this. I’ve not yet programed it to respond to a command, go and pull the states of a bunch of Items, and then speak a digest (e.g. “The outside temp is currently 85 degrees F, the average home temperature is 72 degrees F.”).

It has been quite some time before I’ll get back to this but if you have any questions about what I’ve written I’d be happy to answer them.

No and probably not.

Thank you for posting such a thurough description of your setup. It is pretty amazing how much you have accomplished in this little amount of time.

Don’t be afraid to iterate on what you have done already. To quote a favorite old TV show, “If it ain’t broke, you’re not trying.” Now that you have something that works, you can play and try to find new ways to achieve the same thing, or alternative implementaitons, or more effecient ways to do things.

A couple of minor quibbles. You have some typos above, primarily mqttt->mqtt and rednode->node red.

1 Like

Excellent description of a WIP! Though you describe yourself as a newbie, it seems you are much more!
Thumbs up!

1 Like

@nakh_Home Excellent write-up; it’s very inspiring. I am myself is pretty new with Openhab, but I am already amazed how it enables a very diverse set of architectures. Here’s another perspective, from the little I learnt in this forum and in my own work so far:

  • Aim to automate everything without requiring user action.
  • Things that require user attention (e.g. security alarm, water leakage) should be notified in the form of alerts (e.g. emails, SMS).
  • The above lead to the minimization of items in the site maps. I used to be impressed with how much people have on their Android application, but over time I appreciate the de-clustering to minimum amount of info.

When choosing hardware, I try to select sensors/devices that do not require the cloud. It is unavoidable in some cases however. This also means that sometimes you have to pay more to get local access (e.g. Z-Wave vs WiFi leak sensors).

Also, in terms of architecture, aim to have devices/sensors continue to work even when the Hab server goes down. This tends to imply Z-Wave sensors which unfortunately tend to be more expensive than ZigBee. My guess is that most people ends up with sensors with multiple communication protocols.

1 Like

@rlkoshak

will be glad to have your opinion,

i have some long long select in my scripts.

i am trying a data driven rule but i have no idea to make it.

The goal is to be able from a rule to load the expected behavior from a csv

it could be more simple to maintain and to update

WDYT? Any better alternatives?

Instead of a csv file of use a properties file which had the same syntax as a map file. There are no libraries available for use in Rules DSL for parsing CSV files.

Also, the entire file will need to be loaded and parse every time this rule runs so that that into consideration.

Personally, IMHO if this is information that changes the behavior of your home automation, it belongs in your Items. Your Items are the model of your home automation and resent the current state if your home automation. I wouldn’t not store any state like this outside of Items.

This sounds like you are describing the functionality of the CalDav Command binding.

thank you . you saved me a lot of time (once again)

Kind of but for google assistant, telegram and also google calendar :slight_smile:

Hi @nakh_Home,
I love your excelent write up of your configuration.
But i have a question about the use of the Z-Wave Neo Coolcam Door/Window Sensors. I have a number of these devices in my config, but i am having problems getting them configured right in openHAB.
I see the door sensors status in my sitemap (Binary Sensor). But i do not know how to get the other info from the sensors in my sitemap. You mentioned that the Temperature and Luminance are not working, but i see the Alarm (burlar) and Battery Level are working.

Could you please share a snippet of your items file and sitemap file for these Door Sensors?
I have also Neo CoolCam PIR Sensors. The same applies to the Neo Coolcam PIR sensors which i also use.

Kind regards, Bert

The only channels available are:

grafik

Thanks

items:

Switch PR1_sensor_binary    "motion"   (gMotion)           {channel="zwave:device:4f0192e8:node4:sensor_binary"} 
Number PR1_luminance	"Luminance"  (gHistory)         {channel="zwave:device:4f0192e8:node4:sensor_luminance"} 
Number PR1_temperature	"Temperature" (gHistory)        {channel="zwave:device:4f0192e8:node4:sensor_temperature"} 
Number PR1_battery 		"Battery" (gHistory,gBattery)   {channel="zwave:device:4f0192e8:node4:battery-level"} 


Contact Z_Door1 		"Terrasse"	(gHistory,gBattery) {channel="zwave:device:4f0192e8:node6:sensor_door"}
Switch  Z_Door1_alarm_access  	            		    {channel="zwave:device:4f0192e8:node6:alarm_access"}
Number Z_Door1_battery 		"Door1_battery"     	    {channel="zwave:device:4f0192e8:node6:battery-level"}

Switch PR2_sensor_binary                            	{channel="zwave:device:4f0192e8:node7:sensor_binary"}   
Switch PR2_alarm_general 			                	{channel="zwave:device:4f0192e8:node7:alarm_general"}
Switch PR2_alarm_motion  "motion" 	(gHistory,gMotion)	{channel="zwave:device:4f0192e8:node7:alarm_motion"}
Switch PR2_alarm_tamper 				                {channel="zwave:device:4f0192e8:node7:alarm_tamper"}
Number PR2_battery_level "Battery"	(gHistory,gBattery)	{channel="zwave:device:4f0192e8:node7:battery-level"}    
Number PR2_sensor_temperature 		(gHistory)	        {channel="zwave:device:4f0192e8:node7:sensor_temperature"} 
Number PR2_sensor_seismicintensity 	(gHistory)	        {channel="zwave:device:4f0192e8:node7:sensor_seismicintensity"} 
Number PR2_sensor_luminance 		(gHistory)	        {channel="zwave:device:4f0192e8:node7:sensor_luminance"} 


Switch SwitchDouche      "Douche Dual" (gHistory,glight)       {channel="zwave:device:4f0192e8:node12:switch_binary"}
Switch SwitchDoucheLeft  "Douche Miroir"    (gHistory,glight,gDouche,gParents)       {channel="zwave:device:4f0192e8:node12:switch_binary1"}
Switch SwitchDoucheRight "Douche Spots"    (gHistory,glight,gDouche,gParents)       {channel="zwave:device:4f0192e8:node12:switch_binary2"}

Sitemap

Frame label="Z_Door1" icon="alarm" {
		Default item=Z_Door1		icon="door"
		Text item=Z_Door1 label="Text" icon="door"
		Default item=Z_Door1_LastUpdate   icon="time" 

		Default item=Z_Door1_AlarmAccess
		Default item=Z_Door1_AlarmAccess_LastUpdate   icon="time" 

		Default item=Z_Door1_BatteryLevel
		Default item=Z_Door1_BatteryLevel_LastUpdate   icon="time" 
}


Frame label="PR1" icon="alarm" {
		Default item=PR1_BinarySensor
		Default item=PR1_BinarySensor_LastUpdate   icon="time" 

		Default item=PR1_SensorLuminance
		Default item=PR1_SensorLuminance_LastUpdate   icon="time" 

		Default item=PR1_SensorTemperature
		Default item=PR1_SensorTemperature_LastUpdate   icon="time" 

		Default item=PR1_AlarmBurglar
		Default item=PR1_AlarmBurglar_LastUpdate   icon="time" 

		Default item=PR1_BatteryLevel
		Default item=PR1_BatteryLevel_LastUpdate   icon="time" 
}