This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.
plugwise

[NEW UPDATE] Plugwise Smile P1 (v2.0.0)

gruijter_devgruijter_dev Member
edited April 2018 in Apps
https://apps.athom.com/app/com.plugwise.smile

Plugwise smile P1

Homey app to integrate Plugwise Smile P1 energy meter. A direct connection over IP is used, so there is no need for the Plugwise Stretch.

The app logs and provides flow cards for the following data:

  • Actual power usage/production (W, 10s interval)
  • Totalized power meter (kWh)
  • All individual power meters (kWh)
  • Recent gas usage (m3, of the previous hour)
  • Gas meter (m3)
  • Tariff change (off-peak, true or false)

Ledring screensaver:

  • See how much energy you are using or producing just by looking at your Homey!
  • Is the wash-dryer ready? Am I now producing power to the grid?

The power is totalized for consumed and produced power, during off-peak and peak hours. Production to the powergrid is displayed as negative watts. Only changed values are logged.

To setup go to "Devices" and enter the IP-address and Smile ID. The ID can be found printed on the device, or can be found in the original app from Plugwise. The polling interval can be changed in the device settings.

Donate:

If you like the app you can show your appreciation by posting it in the forum, and if you really like it you can buy me a beer. Feature requests can be placed on the forum.

Paypal donate

Version changelog

v2.0.0  2018.01.14 Complete rewrite to sdk2.
v1.1.2  2017.04.19 Added polling interval setting
V1.1.1  2017.01.07 Fix for flow tokens fw 1.1.2
v1.1.0  2016.12.02 More robust for corrupt smile data. Changed titles of
        individual power meters in Insights and device card.
v1.0.0  2016.11.26 Stable release for Homey v1.0. Update xml2js to 0.4.17. Added
        all individual power meter readings (re-pair is required to use)
v0.9.16 2016.11.07 Compatibility 0.10.9. Breaking fw change: Device must be
        deleted and paired again. Fix 'cannot read property' crash. Improved gas
        usage logging in insights.
v0.9.15 2016.10.18 Removing 0 readings after app restart
v0.9.14 2016.10.01 Compatibility 0.10.1+. Breaking fw change: Device must be
        deleted and paired again. offPeak and gas usage can now corectly logged
        in Insights (Thank you Athom!). Fix for occasional crash.
v0.9.13 2016.08.27 Compatibility 0.9.3+
v0.9.12 2016.08.15 Icons inverted. Bug in kWh production fixed.
v0.9.11 2016.08.08 Fixed bug for negative power meter values. Changed power
        meter back to kWh (bug: Insights still shows Wh). Changed off-peak icon.
v0.9.10 2016.08.07 Modified for compatibility to Homey firmware 0.9.2+. Added
        custom capabilities for gas usage and off-peak. Logs for these are still
        missing.
v0.9.9  2016.07.05 Added settings for device card. Ledring settings added. New
        internal device datastructure and migration from v0.9.8. Init after
        pairing changed to Homey firmware compatibility 0.8.33+. Code cleanup
        and optimizations.Testing insights (again) for Tariff. Fixed bug for
        occasional crash on device delete. Fix for crash when no gasmeter present.
v0.9.8  2016.06.13 Fixed bug that made app not work correctly for firmware 0.8.37+.
        Added trigger cards and tokens for power change and tariff change. Added
        condition card for tariff change. Added ledring screensaver. Changed meter
        power to wH instead of kWh to match Homey firmware 0.8.35+. Improved
        connection validation after successful pairing. Some code optimizations.
v0.9.7  2016.06.03 Added meter mapping to cope with different smart meter brands
v0.9.6  2016.06.02 Improved validation process during pairing
v0.9.5  2016.06.01 Release candidate
Tagged:
«13

Comments

  • gruijter_devgruijter_dev Member
    edited June 2016
    v0.9.7 is pending approval by Athom. It solves a critical issue with certain brands of smart meter. I'm now working on improving the app with the capability to use the powerchange value and the tariff (peak, off-peak) in a flowcard. Please let me know if the app works for you, and what suggestions you might have to improve it.

    Edit: v0.9.7 just got approved. Download the new version in the app store if the app crashes after pairing!
  • Nice

    Was waiting for this

    Going to test it en keep you posted
  • Nice

    Very Nice

    Still waithing for the replacement homey to arrive

    But if it is installed this will be the first app running
  • Update 0.9.7 has been released! It fixes a critical error (app crash) for certain brands of smart meters. Please let me know how you like the app, and what you would like to see improved.
  • aloftaloft Member
    @gruijter_dev ;
    I got the following crash error when trying to connect my Plugwise Smile P1:

    Stack trace:

    TypeError: Cannot read property '0' of undefined
    at /drivers/smilep1/driver.js:40:46
    at Parser.<anonymous> (/node_modules/xml2js/lib/xml2js.js:484:18)
    at emitOne (events.js:77:13)
    at Parser.emit (events.js:169:7)
    at Object.onclosetag (/node_modules/xml2js/lib/xml2js.js:445:26)
    at emit (/node_modules/xml2js/node_modules/sax/lib/sax.js:640:35)
    at emitNode (/node_modules/xml2js/node_modules/sax/lib/sax.js:645:5)
    at closeTag (/node_modules/xml2js/node_modules/sax/lib/sax.js:905:7)
    at Object.write (/node_modules/xml2js/node_modules/sax/lib/sax.js:1449:13)
    at Parser.exports.Parser.Parser.parseString (/node_modules/xml2js/lib/xml2js.js:503:31)
  • gruijter_devgruijter_dev Member
    edited June 2016
    @aloft: Thx for reporting this. Can you provide some more background info?
    * Is it a clean install, or did you upgrade?
    * Has it ever worked, or do you always get this error when pairing?
    * which Homey firmware are you using?
    * Could you do the following: with a webbrowser go to

    http://[ip address of your homey]/core/modules

    login with:
    username: smile
    password: your SmileID (the one you also use during pairing)

    You should get an XML output. Could you please send me this xml (in a personal message)?

    Thx!

  • aloftaloft Member
    @gruijter_dev ;
    It is a new install (with a second-hand Smile P1). 
    And i think i found the culprit; If I login to the smile p1 itself, it doesn't show any meters. It does show receiving telegrams, but somehow it is not parsing them correctly. The plugwise app isn't working as well.

    XML is pretty empty  ( I didn't have to login, btw)
    <modules></modules>

    So I don't think it is your app. Although you might add some error checking to prevent the crashing when no meter data is shown.

    Now I have to figure out why the Smile isn't showing any data. Probably data is corrupt which prevents parsing of new telegrams...
  • @aloft:

    well, actually during pairing I am checking for certain data structures to be present. So if the xml output is indeed <modules></modules> it should not pair!

    I think it shows an empty xml if you tried to login before with the wrong password. You could close your browser and try again to login. Also you could try to login to:
    http://[ip address of your homey]

    this should provide a webinterface where it shows the firmware version etc. of the Smile. The current version is 2.1.7.

    Did you install the android/ios app from plugwise? There also you can check the firmware version. If you have an old firmware in the Smile you can upgrade it from there.

    If you still manage to get a xml output, please do send it to me so I can check why my app is pairing to your Smile, but then is not able to read the expected data... 
  • aloftaloft Member
    @gruijter_dev ;
    It's running 2.17 ; but I am still not sure if any telegram messages are arriving; I get some weird output on the status page of the web interface:

    Applicatie

    Logger:running
    Laatste Telegram:CEST
    Laatste verwerking:Mon Jan 25 22:06:16 2016 CEST

    If I change the date (e.g. other timezone, the 'last telegram' will also update to the name of that timezone. It seems so be the last characters of the 'laatste verwerking' part. 

    But this is all a bit offtopic for your app. ;-)


  • I had the same problem

    call them and they will send you a new cable to connect to your meter

    older versions have problems with the new dsrm 4 meters

    i got the new cable including small pcb changed the old one for the new one and i had data instantly
  • @Webster, @aloft,

    I will also add extra code to check the validity of the data every time it reads the smile (which is every 10 seconds). If the data is corrupt the device will be reported offline to Homey. I will release this update within a few days on GitHub. I will upload a new version for the Homey app store after the Homey firmware gets an official update.
  • also after the update to 8.3.38 the data is missing in insigts 


  • bvdbosbvdbos Member
    Strange, for me it isn't missing, all data is still there...
  • New version just uploaded to GitHub for experimental users. (v0.9.8 - 11_06).
    Changes:
    * Trigger cards and tokens for power change and tariff change.
    * Condition card for tariff change.
    * A very cool ledring screensaver that shows actual power use / production.
    * Changed meter power to wH instead of kWh to match Homey firmware 0.8.35+.
    * Improved connection validation after successful pairing to prevent app crash for faulty data / faulty Smile device
  • removed it en reinstalled app after that it is missing completely in insights 

    going to download github now

  • Also with the github version

    no plugwise in insights
  • bvdbosbvdbos Member
    edited June 2016
    Stopped at Fri Jun 10 2016 14:04:13 GMT+0200 (CEST),-1860
    Think that's when I installed 0.8.38...
    Strange, for me it isn't missing, all data is still there...
    What I meant was that the old data was gone. I still receive meter-reading on the app-page though. However, the flow (change>200 W) doesn't trigger anymore (probably the same as bug 682)

  • gruijter_devgruijter_dev Member
    edited June 2016
    @BasVanDenBosch,  @Webster ,

    Yes, the issues you both have must be caused by the new test firmware from Homey (.38). I have de-installed and tested the Smile app again myself to check (GitHub version), but on my stable/official release 0.8.32 everything is running perfect and very stable! 
  • It was ok until 8.3.36

    Emile already tolt that the api has changed

    So maybe a rewrite is needed

  • @Webster , @BasVanDenBosch ,

    I think I found a bug that was causing the insights and flowcards issues. I uploaded again to GitHub. Please let me know if this fixes things for you.

  • bvdbosbvdbos Member
    Both flow and trigger working for me again, thanks! :)
  • Version 0.9.8 is just released in the app store. It adds some major new functionality and support for new upcoming Homey firmware:

    v0.9.8 2016.06.13 Fixed bug that made app not work correctly for firmware 0.8.37+. Added trigger cards and tokens for power change and tariff change. Added condition card for tariff change. Added ledring screensaver. Changed meter power to wH instead of kWh to match Homey firmware 0.8.35+. Improved connection validation after successful pairing. Some code optimizations.
  • App crashes with me....
    invalid device?
  • gruijter_devgruijter_dev Member
    edited June 2016
      @Tim_Brass .  Thx for the feedback! Helps me improve the app for everyone. 
    Could you provide some more info? Eg. What firmmware release are you on, did you do a clean install or an upgrade, did it work before , is it a consistant crash or just sometimes, could you check/send me the xml output as described here gruijter_dev said:
    @aloft: Thx for reporting this. Can you provide some more background info?
    * Is it a clean install, or did you upgrade?
    * Has it ever worked, or do you always get this error when pairing?
    * which Homey firmware are you using?
    * Could you do the following: with a webbrowser go to

    http://[ip address of your homey]/core/modules

    login with:
    username: smile
    password: your SmileID (the one you also use during pairing)

    You should get an XML output. Could you please send me this xml (in a personal message)?

    Thx!


  • bvdbosbvdbos Member
    Is it only me or doesn't the trigger "power change" work anymore?
  • gruijter_devgruijter_dev Member
    edited June 2016
    @BasVanDenBosch : Mmm. I just tested it myself, but everything still works fine on .32 firmware. I however noticed that I have to reboot Homey every once in a while to get stuff working consistently. This is probably caused by the Homey firmware which is still somewhat buggy.

    Did you try to do a clean install of the app?


    1) Remove all flows where the SmileP1 device is used 
    2) Remove the SmileP1 app (in Settings - Apps)
    3) Reboot Homey (in Settings - System)
    4) Install SmileP1 app from the appstore
    5) Pair the SmileP1 device
    6) Create the flows you want to use
  • Re-installed everything. That did the trick. Thanks for the nice app!
  • Good to hear that it works! :)
  • bvdbosbvdbos Member
    Yep, over here too. Notifications on phone didn't work because of the app-version and 433 was down, had to cold-reboot... Hadn't rebooted Homey for a week.
Sign In or Register to comment.