LAMetric 3P Plugin - Beta
This is a HomeSeer HS3 plugin for the ‘LAMetric Time’ line of smart clock dispaly units (http://lametric.com/), this plugin has been developed using the LAMetric Time LOCAL API, it does not utilise any of their cloud services and instead talks to your device on the LAN rather than relying on a cloud service. This plugin is to be installed from the updater as any other plugin, unless running the plugin remotely (see later) then HSPI_LAMETRIC3P.exe should be placed inside the main HS directory by the updater. Once the files have been installed by the updater then in the HomeSeer UI go into the Plug-ins > Manage page, you should now see the LAMetrc Time plugin in the list of plugins. Please now enable this plugin by clicking the switch as you would any other plugin.
Upon enabling the plugin you should see some entries in the HomeSeer log similar to this:
Jan-02 21:27:45 Plug-In Finished initializing plug-in LaMetric 3P
Jan-02 21:27:45 LaMetric 3P No IP Address Specified In INI File - Please Update
Jan-02 21:27:45 LaMetric 3P Getting IP Address For Instance
Jan-02 21:27:45 LaMetric 3P Connection Worker Thread Started
Jan-02 21:27:45 LaMetric 3P Icons In Table: 1
Jan-02 21:27:45 LaMetric 3P Adding Icons To Table
Jan-02 21:27:45 LaMetric 3P Registering Web Pages
Jan-02 21:27:45 LaMetric 3P Devices Exist For Instance: False
Jan-02 21:27:44 LaMetric 3P LAMetric Time Plugin Started
Jan-02 21:27:44 Info Plugin LaMetric 3P has connected. IP:127.0.0.1:39388
As the HomeSeer log suggests, the IP address and also an API key needs to be set for HomeSeer to communicate with the LAMetric Time device. Please go into Plugins > LAMetric 3P > LAMetric 3P page and you should find two tabs labelled Home and Settings. Please click Settings and you should find a page similar to this:
These fields are fairly self explanatory, the instance name will report as ‘Default’ if you have no instance name passed to the plugin. The next field is for the IP address of the LAMetric unit and then the API key (see next chapter). The plugin establishes a connection with the LAMetric unit that is opened whenever the plugin either needs to query the unit or send a notification. Once you have entered the required details please press Update Changes, you will see little change in the UI but please now look in the HomeSeer log. If you have established a connection with your LAMetric unit then the HomeSeer log will contain entries looking like:
Jan-02 21:33:38 LaMetric 3P LAMetric Time Device Connection Success
Jan-02 21:33:38 LaMetric 3P WiFi Strength: 100%
Jan-02 21:33:38 LaMetric 3P Device ID: 4241
Jan-02 21:33:38 LaMetric 3P Device Name: LM5844
Jan-02 21:33:37 LaMetric 3P API Key Discovered: f261b85edfd48f6b9749422103
Jan-02 21:33:37 LaMetric 3P IP Address Discovered: 192.168.1.97
Jan-02 21:33:37 LaMetric 3P Getting IP Address For Instance
Jan-02 21:33:37 LaMetric 3P Connection Worker Thread Started
Please check whether or not the plugin reports that it established a connection and whether or not you have the entry marked as device connection success, if you have then the plugin should now be ready to communicate with.
HomeSeer will create a group of three basic devices for the plugin, these devices in the main will be self explanatory. You should find that the devices look as follows:
All devices contain value/graphics pairs that have been taken from the HomeSeer contemporary image set. You are free to change them to whatever images you feel suitable by editing the pairs in the plugin pages. All of the devices should change status and can be used in events to display screens, obtain images or whatever actions you feel appropriate.
There are now (as of version .7) four event actions and no triggers. As the plugin utilises the local LAN API then the ability to send data is more limited than the cloud API. You are able to send notifications to the unit however responding to any button presses on the unit is not possible. The information for this is contained in the API documentation - http://lametric-documentation.readthedocs.io/en/latest/reference-docs/device-notifications.html
The event action will look like this;
The first drop down will enable you to determine what sort of message you wish to send, the options are either a simple frame (just text or text and an icon), a spike frame (a comma separated list of numbers to display as a chart) or a goal. The goal will have a start, current, end and unit that will show as a tracker. The rest of the options are relatively easy to understand, when finished ensure you press the update button before attempting to collapse the event. The plugin now has support for multiple frame messages, the single frame actions are still retained
Application Specific Actions
The API for the LAMetric now supports both moving between applications, activating a specific application or sending data to an application. As such it should now be possible to do things like set the alarm clock, set a countdown clock, display the weather forecast etc by HomeSeer event action.
Please be aware that I cannot test every app in the LAMetric app store, there may be some apps that have unusual actions that expect different data - if you encounter an issue please inform me and I’ll do my best to try and fix it but I can make no assurances that I will get it working.
The new actions look like this;
Once you have inputted the required data for the particular action then ensure you press the update button before collapsing the event.
Indicator Application Functions (Version 0.0.0.10 or later)
Please note that this function will involve using the LAMetric Cloud Service - it is NOT a local connection
The plugin as it currently stands supports notification applications, this means that when an event happens and you send the event action the notification will appear straight away on the LAMetric device. LAMetric support a different kind of application called indicator applications, these are the standard applications that are on the device that are similar to the weather, news or email display applications that you download from the store. I have now (0.0.0.10 or later) added the ability to be able to send data to an application from a HomeSeer event, this means that you can have your own application to display data much the same way as the weather data or similar. Please note that setup of these is not always straightforward and please pay close attention to the following;
In HomeSeer you will now have an additional event action to push data to a LAMetric application, before you make any attempt to create an event you will need to add this application to the plugin. Go into the plugin settings page and you should now have some additional fields at the bottom of the page, please enter a local name for the application (this is only used in HomeSeer so you are aware of which application you are updating) and then the URL/application token in exactly the same format as given to you on the LAMetric website. The dialog box above should then update with the application details (with a truncated URL), if you open the LAMetric.ini file you will also see that the data has been added to this file.
Now you should be able to send data to your application and this will be done by an event. This event should be run whenever you wish to update the data however I would recommend that the event is structured in such a way that it cannot send data at a high rate (the API document does not specify however setting the cannot retrigger event property is probably the safest way to achieve this). It does appear that the structure sent by HS should be similar to that the application was initially setup, if you only set a single frame of text it will not update if you then attempt to send a chart to the unit. If you have set up the app to have a single text frame followed by a chart then your HS event should mirror this.
When you send the data to the device please check the HS log that you have been able to send the data and then it should (when the application next revolves on the LAMetric device) display your updated data.
This functionality is still potentially in it’s early stages so please report any issues on the forum.
There are no functions available in the plugin in terms of scripting, this is because of the existing functions available in the events and the fact that the event actions are relatively complex. If there is a specific function requested then this can be considered.
By default there is only one icon added when the plugin loads (which is actually no icon), because of the difficulties in implementing a icon editor then I have decided to add a method to download an icon from the official list of icons. If there is an icon you wish to add to the plugin then please go to the official icon page here https://developer.lametric.com/icons
Pick a list of icons you wish to include and note down their numbers, also note down whether or not they are animated. Then open up the LAMetric.ini file in the HomeSeer config directory. Add a section labelled [Icons] and then a line marked IconList. The format of the list of icons to download is a comma separated list with the starting letter being ‘m’ for moving or ‘s’ for static. Then add the line like this;
When the plugin then is re-loaded it will look to download the icons with those particular numbers and then it will save the data for that icon inside a table within the plugin. When you load the plugin it should display a count of the downloaded icons.
Getting an API Key
The plugin requires an API key from LAMetric before you attempt to communicate with it, log into the LAMetric site and go to https://developer.lametric.com/user/devices - you should be presented with a screen similar to this, please press Devices and copy the API key.
This API key needs to be copied and inserted into the API key box on the plugin settings page.
Please post any issues/comments/requests to the appropriate HomeSeer message board thread and I will try and answer them accordingly - https://board.homeseer.com/showthread.php?p=1285244