Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Any chance of seeing Room Temperature from SmartSi via MQTT?

I've got a SmartSi and would like to import the room temperature into Open Energy Monitor via MQTT. Is there anyway of getting access to this?
If not is it something that can be provided in future?
1 person has
this question
+1
Reply
  • In OpenHAB, you could achieve this with a single line in a text file:

    Number RoomTemp "[%.1f]"
    { ecobee="<[your_therm_id#runtime.actualTemperature]"
    mqtt=">[mybroker:/myhouse/room/temp:state:*:default]" }

    You would set up your ecobee authorization (and temperature scale) and your MQTT broker configuration in the file openhab.cfg (with a few more lines of text).

    OpenHAB is a free, open-source home-automation system that runs on any computer (PC, Mac, Linux, cloud, Raspberry Pi...).
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • That makes sense from a receiving point of view, however how do you get either Ecobee's server or preferably the SmartSi itself to output the topic?
    I'm a relative MQTT newbie so please excuse any obvious questions
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • There were formatting problems with my original reply (less than and greater than) symbols. View my edited post to see the proper example. OpenHAB would be acting like a bridge between Ecobee's API and the MQTT destination.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • Correct example:

    Number RoomTemp "[%.1f]" { ecobee="<[your_therm_id#runtime.actualTemperature]",
    mqtt=">[mybroker:/myhouse/room/temp:state:*:default]" }
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • Ah, that makes sense - is there an easy way to get to the api? Maybe a FAQ?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • You could write your own Ecobee API client and MQTT client, but OpenHAB has already taken care of all the coding already: you just specify an "item" and what systems it is bound to (Ecobee and MQTT in your case, but there are over a hundred other integrated systems)

    When the Ecobee temperature is updated, it will be sent it to the MQTT broker/topic for you. All you have to do is configure the connection details in the openhab.cfg file.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • OK, I've had a play with this and come to a dead end. The install appears to be in /etc/openhab. To this I've created a directory called addons and put the following in there (all using sudo as it seems the etc directory is locked tighter than a prison.
    org.openhab.binding.ecobee-1.7.0.jar
    org.openhab.binding.mqtt-1.7.0.jar
    org.openhab.binding.openenergymonitor-1.7.0.jar
    I've also created / edited /etc/openhab/configurations/openhab.cfg
    According to the pi openhab is running yet pointing a browser at port 8080 on the pi gives me
    Sitemap 'default' could not be found
    Am I missing something? Is there a sitemap for those not that familiar with Linux/Raspbian?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • An install from apt-get goes into several top-level directories. Only the editable text configuration files go somewhere under /etc/openhab.

    There is a directory /usr/share/openhab/addons where the JARs go, but you would be better off doing sudo apt-get install openhab-addon-binding-ecobee, sudo apt-get install openhab-addon-binding-mqtt and so on. See the install wiki https://github.com/openhab/openhab/wi... .

    The wiki pages and Google Group at https://groups.google.com/forum/#!for... have all the answers for how to install and configure OpenHAB.

    Good luck!
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • This reply was removed on 2015-06-23.
    see the change log
  • John,
    having not got this to work I'd almost given up on openhab when I found this excellent guide here http://www.homeautomationforgeeks.com...
    I now seem to have openhab showing up in a web browser and maybe I can get it to interrogate ecobee's servers by modifying a few things.
    I'll update this post later in case I can save anyone much frustration in future!
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • I'm very pleased to say I've got it working, however I think I may have found a bug - it works if I accept the values in F, but it fails if I try to get them in C by uncommenting "ecobee:tempscale=C" in openhab.cfg

    Curiously enough the API documentation states:

    "If the user preferences indicate the use of Celsius values, it is the responsibility of the caller to convert values to and from Celsius." So I guess this is a binding error?

    errors below:

    2015-06-23 14:12:15.515 [ERROR] [.ecobee.internal.EcobeeBinding] - Unable to get state from thermostat
    java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.
    at java.math.BigDecimal.divide(BigDecimal.java:1690) ~[na:1.8.0]
    at org.openhab.binding.ecobee.internal.messages.Temperature.toCelsius(Temperature.java:162) ~[bundlefile:na]
    at org.openhab.binding.ecobee.internal.messages.Temperature.toLocalTemperature(Temperature.java:144) ~[bundlefile:na]
    at org.openhab.binding.ecobee.internal.EcobeeBinding.createState(EcobeeBinding.java:423) [bundlefile:na]
    at org.openhab.binding.ecobee.internal.EcobeeBinding.getState(EcobeeBinding.java:380) [bundlefile:na]
    at org.openhab.binding.ecobee.internal.EcobeeBinding.readEcobee(EcobeeBinding.java:343) [bundlefile:na]
    at org.openhab.binding.ecobee.internal.EcobeeBinding.execute(EcobeeBinding.java:232) [bundlefile:na]
    at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:156) [org.openhab.core_1.7.0.jar:na]
    at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:173) [org.openhab.core_1.7.0.jar:na]
    2015-06-23 14:12:15.535 [INFO ] [runtime.busevents ] - RoomTemp state updated to Uninitialized
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • Yes, this is a binding error. Sorry about that. I can supply you with a new binding JAR with a proposed fix, if you will let me know if it fixes/doesn't fix the problem. What that be OK?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • Try this JAR, please, and let me know if you are getting proper Celsius values with no errors: https://dl.dropboxusercontent.com/u/4...
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • Thanks for the file, however for reasons best known to itself Ecobee and my pi have fell out. It was working for most of the day before it came up with a not responding error.
    To try and resolve this as I was playing with Samba and permissions at roundabout the time it died, I've deleted and reinstalled openhab and recreated the app on the developer dashboard twice whilst changing the API Key in openhab,cfg.

    It reports
    2015-06-24 19:01:40.475 [WARN ] [g.openhab.io.net.http.HttpUtil] - Method failed: HTTP/1.1 500 Internal Server Error
    2015-06-24 19:01:40.481 [ERROR] [.ecobee.internal.EcobeeBinding] - Token has been deauthorized by user. You must re-request authorization.

    Openhab was running on a read only file system when it died - do these tokens expire?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • Ecobee's API often invalidates old tokens, so the binding fetches new ones fairly frequently (perhaps every hour).

    The binding is probably still trying to use stale tokens stored in ~/.java/.userPrefs . Just rm -rf that directory and restart OpenHAB. The Ecobee binding will not find the old tokens, and will then ask you to authorize a new PIN that appears in the log, with ecobee.com. If your OpenHAB file permissions are OK, it should succeed in saving the new tokens in their proper home from here on out.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • Where is this likely to be? I can find
    /etc/.java/.systemprefs/.system.lock and .systemrootmodfile
    is that it or somewhere else?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • The ~ (tilde) means the user's home directory in Unix/Linux. So under whichever user you are running OpenHAB (a user named "openhab" is recommended but you may have set it up differently) would have a .java directory.

    Java Preferences storage locations are platform-specific and not under the control of the developer (so I wouldn't be able to accommodate moving it to some other path).
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • its installed in /home/pi/data and started by sudo so I guess this is root?
    The Pi is set in read only mode usually to limit writes to its SD Card which seems to upset openhab and no doubt along the way has upset the token. The data directory is where emoncms keeps its databases so it has rw access and I assumed openhab should work in there.
    Deleting the /etc/.java/.systemprefs didn't fix it
    I'm assuming it isn't anything forward of /home/pi/data/openhab as I deleted the lot earlier.
    Is there any way of finding the variable that points to this tokens location? On windows a simple "set" would list them, however experience tells me it won't be that easy for a novice like me!
    • view 17 more comments
    • Thanks for the report. I hope/expect the ecobee:tempscale=C fix will be in the OpenHAB 1.7.1 release.

      The Ecobee action bundle is marked for release with OpenHAB 1.8.0, but you can use this JAR in the meantime if you like:
      https://dl.dropboxusercontent.com/u/4...

      The actions you can use with it are described in the pull request here:
      https://github.com/openhab/openhab/pu...
    • Thanks, I'll have a play at some stage and report back
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited