Something easy to start with

Hello,

I’ve been going at it (OH3) fairly strong the past month and I’ve added a bunch of ‘things’ (17 to be exact, like lights, a sensor, a power outlet, cell phone) and have created 153 ‘items’ from those things. I’m not exactly sure what all 153 things do or what I’m supposed to do with them, but hey, I’ll get there hopefully. I haven’t been able to figure out rules, pages, and scripts yet, but I’ll get there hopefully too.

The “Getting Started” tutorials are really good most of the time, but I get lost when they give examples using equipment that I don’t have (like a MiFlora device found in the following tutorial: Adding Things - Advanced | openHAB). In fact, that page is where I first hit a bump (all the other getting started pages up to that point I understood completely). I pushed forward and read through all the remaining/following webpage tutorials (Semantic Model, Persistence, Pages-Introduction, etc) and some of it makes sense and some not.

Anyway, I was wondering if there is something easy I can use in lieu of the MiFlora device for adding something using MQTT? Specifically something internet based, so there is no need to buy a piece of hardware? I’m not against buying something, but I’d like to understand how it all works and I don’t want to wait for something to be shipped. Maybe what I’m asking for isn’t possible, I have no idea.

And one more question while I’m here. :slight_smile: I’ve read and read and read some more on these forums, on the OH website, on some 3rd party blogs, and have also watched the OH youtube site…I remember a post on the OH forums during all the reading giving somebody a list if things they could add, do, and try that could get you started without buying/getting anything that would help you (me in this case) get started. I’ve got a pretty good start (I think), but if there is more stuff out there that’s easy to set up and I can do all on the PC without getting physical equipment that would be something I’m interested in. Does anybody have any suggestions for something like that? Something easy to set up that I don’t need anything special (other than the PC I’m already using)?

Thanks for reading. :slight_smile:

–ABP

1 Like

It would help perhaps to understand what you don’t understand or what you are getting stuck on. I very much doubt that switching to some other device that uses MQTT is going to address any issue you may have with it. No matter what the device is, for MQTT you have to:

  1. Create a Bridge Thing with the connection parameters for the MQTT Broker
  2. Create a Generic MQTT Thing using the Thing created in step 1 as the broker
  3. Create Channels on the Thing created in step 2 for each MQTT topic to publish and subscribe to. Repeat for each topic.

It could be a MiFlora, DIY ESP device, Shelly, Zigbee2MQTT server, or almost anything else. If it uses MQTT, those are the steps

So is the confusion with what MQTT is and how it works? Or is it in figuring out how to configure openHAB to speak MQTT? If the former, I recommend reading up a bit on MQTT. MQTT Essentials - All Core Concepts explained presents an excellent tutorial.

If in the latter, show your work so we can figure out where you are going astray.

To be successful with MQTT, as with pretty much anything that openHAB interacts with, requires at least a basic understanding of the technology in use. For example, if you want to use the Exec binding, you need to understand users, permissions, file paths, and stuff like that. To use the HTTP binding you need to understand GET and PUT and POST and HTTP headers and stuff like that. To be successful with MQTT you need to understand brokers, and topics, subscribing and publishing, and stuff like that.

Changing the device isn’t going to change any of that. But on the bright side once you understand it you can handle any MQTT device. It’s kind of all or nothing.

  • OpenWeatherMap
  • System Info
  • Network
  • Astro
  • iCal (assuming you have a Calendar hosted somewhere (e.g. Google) that supports iCal format)
  • Exec binding to run local scripts
  • HTTP binding if you have a web page you want to extract information from

Or you can use nothing at all. You can create Items and write rules and create widgets without linking those Items to anything. You can simulate a whole house if you want to with rules and behaviors and visualizations without touching any real devices.

After all, that what https://demo.openhab.org/ does.

Hey the community here is great and I’m sure will be able to guide you.

What are the 17 things you have added that?
How many bindings are you using?

Thank You rlkoshak!

Wow, what a response! I whole heartedly thank you!

I guess with the MQTT I (thought) I had a grasp of it, but it looks like I need to take a pause with OH and dive into the HiveMW website and really learn things and come back to OH when I have a much better understanding. My confusion is basically how it works AND figuring out how to configure OH to speak MQTT. My thought process was having an example that I could process through (in lieu of MiFlora) would help. I understand now that I need to dive into MQTT and really get a good understanding before I proceed.

This was extremely helpful as well. I’ve read something along these lines in the tutorials, so it’s nice to hear that from you too. I definitely need to learn and understand some things as they come. I do not know what the Exec binding is, but have come across that name (of the binding) over the past month. I have not come across the HTTP binding, but I know that’s not the point. What I do understand though, is your point in that paragraph. So thank you again.

Thanks for the list of things I can set up and for the further explanation of “doing nothing at all” :smiley: That really opened my eyes and I really appreciate it.

Thanks again!! :slight_smile:

Hi clinophobic!

Thanks for replying to me!

Here are the 17 things: :slight_smile:

  1. My Cell Phone

  2. All lights (LightGroup)

  3. 4-1 SENSOR
    ONLINE

  4. ZWAVE BRIDGE

  5. FRONT DOOR INSIDE LIGHT

  6. KITCHEN HUE BULB 1

  7. KITCHEN HUE BULB 2

  8. KITCHEN HUE DIMMER SWITCH 1
    ONLINE

  9. KITCHEN HUE DIMMER SWITCH SCENECYCLER 1

  10. KITCHEN OUTLET SWITCH (Z-WAVE)

  11. KITCHEN LIGHTS

  12. LIVING ROOM HUE BULB 3

  13. Local Moon

  14. Local Sun

  15. Local Time

  16. MQTT Broker

  17. Philips hue Bridge

And I currently have 7 bindings!

Thanks again clinophobic!

To start I will let you know that I classify myself as a step above a novice and this is just my personal take on getting started.

I’m not too sure if you have any mqtt equipment. I could be wrong.

The next logical step for you is too work out what u want to automate.

For example if the 4 in 1 sensor is (Motion/Light/Temperature/Humidity) you could automate the lights to switch on if motion is detected and the light(lux) is below a certain threshold.

The post below should help with understanding how to create a rule to do this.

What is the right trigger for this rule?.

From personal experience you will never get your system set up correctly on first setup and it is ever evolving and you will be forever learning. The more you learn the more you will think to yourself. ‘I could get a rule to automate that’.

I have even seen in posts the wizard of rules @rlkoshak is still learning.

I probably wrote some of those tutorials so at least I’m being consistent. :wink:

It executes external programs and scripts from openHAB. Sometimes the integration requires calling out to something not built into openHAB itself.

If I wasn’t still learning it wouldn’t be fun any more. :smiley:

That does bring up a good point. @ABP, just because the Getting Started Tutorial talks about the MQTT binding doesn’t mean you have to use exactly the MQTT binding. You may never have need for MQTT. The purpose for the three Things tutorial pages is to provide examples for the creation of Things. There are three “categories” of Things based on how much work it is for you to set them up.

Simple Things are simply discovered. You need to know next to nothing about the underlying technology and you don’t have to do anything special beyond running a scan from the Inbox. That’s the first example and Hue was chosen as the exemplar. But that doesn’t mean you need to use the Hue binding nor that only the Hue binding works in that way. Lots and lots of bindings work the same way.

Intermediate Things require a little extra work. In order to connect openHAB to the technology you must first manually create a Bridge Thing and set the connection configurations. However, once that’s done it works the same as Simple Things. Go to the Inbox, run a scan and all the Things are discovered for you.

Advanced Things though require you to manually configure pretty much everything. These tend to be low level technologies and they require you the user to have the greatest understanding of how the underlying technology works. MQTT was chosen as it’s the most commonly used example but it’s not the only binding like that. KNX, Modbus, HTTP, Exec, etc. are all Advanced Things. In this case there is limited to no automatic discovery so you the user have to manually create and configure each Thing by hand.

You may only ever have Simple and Intermediate Things to deal with. You may have Advanced Things too but maybe they are not MQTT. In that case the Getting Started Tutorial is providing an example based on MQTT. But you will need to be able to abstract and apply that to the binding you are using (e.g. KNX).

One of the best skills you can develop with learning and working with OH is to be able to generalize what you are reading and apply it in other contexts. Everyone’s home automation is unique so you are unlikely to ever find an end to end tutorial that covers everything you need. But you will find an MQTT tutorial and an Zwave tutorial, and a couple of Widgets and several rule tutorials that you can follow, modify and customize to build your home automation with. The Getting Started Tutorial is just one such.

Good luck and do not spend hours and hours spinning your wheels. Come and ask questions. If you show that you’ve tried stuff on your own and a willingness to learn we love to help.

3 Likes

WOW! THANK YOU clinophobic & rlkoshak!!

Apologies for taking so long to reply. I read your replies back when you originally wrote them, but I couldn’t find time to sit down and reply back. Since then I’ve learned a lot about what you both talked about. Thank you so much. Here’s what I’ve been up to since our last correspondence :slight_smile:

clinophobic you’re right - I don’t have any mqtt equipment. And rlkoshak your well articulated response on mqtt (and everything else) was VERY helpful! I’ve since read up a lot on mqtt and what it is and what it does, etc. I read a lot on the HiveMQ website (and a little bit here and there on other spots around the web) about the mqtt protocol. HiveMQ had/have a great 12-part blog series that really explained in detail how mqtt works. I’ll be referencing that if/when I ever have the need for mqtt.

clinophobic you’re right the next logical step for me was/is to workout something to automate. I had tried and (gulp) failed to set up automation. After your response with the link to the other post I had renewed hope and tried again. Funny story here: I tried to automate something easy to start out with - I just wanted to see automation work, so I chose to automate my kitchen lights to ‘turn on’ at 1:30PM each day. So, 1:30PM rolls around…nothing. I edit the rule and change the time for a few minutes later and each time “the time” came around to turn on the lights…nothing! I edited the rule and got to a point where I was 100% confident the rule parameters were all correct and I was getting really frustrated, so after a couple hours of doing this I just stopped and left the rule alone (“turn on lights” at 3:30PM each day). So, everyday at or after 3:30PM I’d check the lights and they were always off. Argh! Well…on a random Saturday morning, I’m sitting at my dining table at 8:30AM and my kitchen lights turn on all by themselves! What? Why? And it donned on me that I was always having to turn the lights off between 8:30AM-9:00AM each day. What was happening is whatever clock/time Openhab is using is off by 7 hours! (The rule was set for 15:30, but the rule was working at 8:30AM!) Even though the time was off, I jumped out of my seat realizing automation was indeed working! The amount of JOY of seeing automation work was just AWESOME. I edited the time in the rule by adding 7 hours to the real time I wanted (i.e. if I wanted the rule to fire in real time at 8:45AM in the morning, I would set the time for the rule as 15:45) and got the lights to automate on every time I tested this. Awesome!

I have no idea where/what/how Openhab grabs the time? I do have OH set up for my timezone (I’m pretty sure correctly). I do have the astro binding installed, but it’s just a bunch of ‘items’ on my items page currently. If anyone can please aid/push me in the right direction about how to get the time correct, I sure would appreciate it. I would like to be able to put “8:30AM” in my rule instead of “15:30” for the rule to fire at 8:30AM, lol. :slight_smile:

Another update (and good story) is I bought a z-wave outdoor plug recently because I want to automate my outdoor Christmas lights to turn on and off each day. Once the z-wave plug came, I was able to pair the plug and add it to OpenHab with relative ease! I couldn’t believe it. This process in the past has taken me a lot of time from start to finish and I got it working in 5-10 minutes! YES! I’m getting better. I realize now that this is a pretty easy thing to do in the grand scheme, but it’s a big win for me, lol. :slight_smile: I also set up two rules for the Christmas lights (technically the z-wave plug) to “turn on” at 6:00PM and then (the second rule) to “turn off” at 12Midnight. (Again, I had to add 7 hours to the rules, so for example 6PM in the rule is set for 1:00AM). Even though the time thing is an issue I am ESTATIC to have something automated and have a real purpose! Like, REALLY ESTATIC! I enthusiastically watch the Christmas light come on all by themselves each night, lol. I know there are fancier ways to automate the Christmas lights (like turn on at dusk and stuff), but I’m just getting started and have to learn the fancier stuff. :slight_smile:

Thanks for reading and I hope you enjoyed my story or success and shortcomings, lol.

The next thing I’d like to add are IP cameras to set up around the house (inside the house, not outside the house). I’ve read A LOT on the OH forums about IP cameras and holy moly there is a lot of info. One thing I haven’t ever been able to find is a good answer to “what IP cameras to buy”. I know this is a doozy of a question (based on so many forum posts and opinions on the subject, lol), but is there any kind of brand(s) of IP Camera(s) that are “universally accepted” by the OH community? Any go-to IP cameras that are easy to set up with OH? Thanks so much. If anyone is able to push me in the right direction here as well I sure would appreciate it. I’ve started here (IP Camera - Bindings | openHAB) and here (IpCamera: New IP Camera Binding) and have read LOTS of forum posts. I just want to get a good head start before buying some cameras and then realize they’re going to be too much of a pain to set up in OH and learn after the fact that there are other IP cameras that are simpler to set up in OH (maybe all IP cameras set up the same in OH, but it doesn’t seem like it based on hundreds of forum posts, lol).

ABP

For the time zone there are three potential places to look.

  1. the operating system: look up in Google for “set timezones in x” where x is your operating system.

  2. In MainUI under settings - regional settings

  3. Java itself has a time zone setting. See How to set the timezone for the Java environment | Atlassian Support | Atlassian Documentation

I’m glad you stuck to it and got something working. It’s very satisfying and it’s given you a good foundation to build upon.

As for cameras, there is no general advice or recommendations. Look at the binding docs and you will see some makes and models that are explicitly supported by the binding, but that may be because they work in odd and non-standard ways. But the binding does support cameras that implement RTSP or OVIF.

There are a lot of cameras with proprietary standards (e.g Wyze) so be careful there.

Thank You, Thank You, THANK YOU rlkoshak!! I got the time issue figured out!! The timezone for both mainUI & Java was the problem! I first updated the mainUI which didn’t fix the issue then updated the Java timezone and boom! It worked! I’ve tested the time in the rule a few times now and that issue is resolved! AWESOME!! THANKS AGAIN!!

Thanks too for the note on the cameras. :slight_smile: I read whole other thread a while back about Wyze cameras and basically learned what you mentioned that they won’t work with OH. So I really appreciate it. I’ve read a bunch of other threads about cameras where someone has done a bunch of workarounds to acquire the product key (or whatever it’s called) to get a particular brand of camera to work with OH. I also read some other threads about having to do some kind of work around and needing to initially use the manufacturers app on a cell phone to get the IP address from the camera’s config file or something like that just to be able to use the camera in OH, etc. I have no desire for any of that, lol. I just want to get a camera(s) that are easy to set up & work in OH. I’ll hopefully get it figured out! Thanks again!!

ABP

Okay, after going down the rabbit hole a little bit on IP cameras yesterday, I think I’m going to kick that project down the road for now. Just trying to figure out cameras to purchase that are open API is a struggle. I’ve never heard of ONVIF before yesterday (I mean, I read the word when I read the binding page before yesterday) and again, just trying to figure out cameras to purchase that are truly ONVIF cameras is a struggle. And so forth. Will did deeper at a later date.

For now, I think I’ll add more stuff that I already know how to do like adding lights and make rules for them to spruce things up. :slight_smile: I’ll try to figure out how to use the 4-in-1 sensor to automate the lights like clinophobic mentioned. Next thing I’d like to try my hand at are running scripts.

Thanks so much everyone for all the help.

ABP

Read the below post and choose one of the Dahua cameras mentioned, or Hikvision all work if they advertise ONVIF support. Usually it is only the doorbell/intercom cameras that you need to be careful about which model in the range you get, the turret and bullet cameras probably all have ONVIF.

What is a decent IP cam for my budget? | Page 2 | IP Cam Talk

AWESOME! Thank You matt1! That really helped explain things. I read the whole thread too and lots of good info there. :slight_smile:

I think I’m going to forgo cameras for now. As I read more and more about different things in the home automation world, I realized cameras aren’t really the direction I want to go at the moment. For now, I just want to add different things around the home and automate them and have fun with them. :slight_smile:

I’m also getting a better handle on rules and getting them to work. I tried my hand at automating something with the 4-in-1 sensor and can’t get the ‘motion’ part to work. Before getting into that, lol, I made a rule just to test the 4-in-1 sensor that when the sensor luminance changes (any change) the kitchen lights would come on. So, after saving the rule, I watched the sensor (luminance channel) in OH which started with a reading of 68 and then I covered it up with a baseball cap to make it darker and as soon as the sensor reading changed (it went to zero - the baseball cap did the trick!) the lights came on! YEA!

I then started to work on trying to use the motion sensor (using the same 4-in-1 sensor used for luminance above), but I think the 4-in-1 sensor is simply not detecting any motion (as in it doesn’t seem to be detecting any motion 24/7). When I watch the motion sensor in OH (watching its motion channel and clicking analyze there is not any graph data present). OH does show the motion status for the channel as “OK” (not NULL, which I would think is a good thing?). So, this is where I’m currently stuck. The 4-in-1 sensor is a Zooz ZSE40. If anybody has and ideas, I sure would appreciate it!

–ABP