项目作者: prysme01

项目描述 :
Magic Mirror 2 JEEDOM Module
高级语言: JavaScript
项目地址: git://github.com/prysme01/MMM-Jeedom.git
创建时间: 2017-11-14T10:42:30Z
项目社区:https://github.com/prysme01/MMM-Jeedom

开源协议:GNU General Public License v3.0

下载


Magic Mirror 2 - JEEDOM Module

This module displays any JEEDOM command value. The information will be updated depending on the polling time.

If a PIR-sensor using MMM-PIR-Sensor module is used, this information will not be updated during screen off.

The infos will also not be updated when no instances of the MMM-Jeedom module are displayed on the screen (for example hidden by using MMM-Remote-Control or any carousel like MMM-Pages). This will allow to reduce the number of request to Jeedom API.
As soon as one MMM-Jeedom module will be again displayed on the screen, all the instances will request an update of the datas.

alt text

alt text

alt text

Module installation

Git clone this repo into ~/MagicMirror/modules directory :

  1. cd ~/MagicMirror/modules
  2. git clone https://github.com/prysme01/MMM-Jeedom.git

and add the configuration section in your Magic Mirror config file :

Module configuration

(1st example of the screenshot) :

  1. modules: [
  2. {
  3. module: 'MMM-Jeedom',
  4. header: 'Jeedom Maison',
  5. position: "top_left",
  6. config: {
  7. updateInterval: 3000,
  8. jeedomAPIKey: "",
  9. jeedomURL: "192.168.0.1 or hostname",
  10. jeedomPORT: 443,
  11. jeedomHTTPS: true,
  12. jeedomAPIPath: "/core/api/jeeApi.php",
  13. sensors: [
  14. {
  15. idx: "127",
  16. symbol: "fa fa-bolt",
  17. customTitle: "Consommation Maison",
  18. unit : "Watt",
  19. },
  20. {
  21. idx: "695",
  22. symbol: "fa fa-thermometer-full",
  23. customTitle: "Temperature Rez de Chaussee",
  24. unit : "C°",
  25. },
  26. {
  27. idx: "773",
  28. symbolon: "fa fa-user",
  29. symboloff: "fa fa-user-o",
  30. customTitle: "Adrien",
  31. boolean : true,
  32. },
  33. {
  34. idx: "6031",
  35. symbol: "fa fa-music",
  36. customTitle: "Musique",
  37. hideempty:false,
  38. },
  39. ],
  40. Virtual_API: "", // Code APi de vos virtuals
  41. TempID: "5089", // ID pour l'info température
  42. HumID: "5088", // ID pour l'info d'humidité
  43. }
  44. },
  45. ]

Example how to use 2 infos on the same line :
(2nd example of the screenshot)

  1. sensors: [
  2. {//first info (value and unit only)
  3. idx: "1987",
  4. sameLine1: true,
  5. unit : "°C",
  6. },
  7. {//second info (title, symbol, value and unit)
  8. idx: "1988",
  9. customTitle: "Météo",
  10. symbol: "fa fa-sun-o",
  11. sameLine2: true,
  12. unit : "%",
  13. },
  14. { //this one display only 1 info on its line
  15. idx: "1996",
  16. symbol: "fa fa-cloud",
  17. customTitle: "Condition :",
  18. },
  19. {
  20. idx: "1495",
  21. //customTitle: "Grenier",
  22. sameLine1: true,
  23. unit : "°C",
  24. },
  25. {
  26. idx: "1496",
  27. customTitle: "Grenier",
  28. symbol: "fa fa-thermometer-half",
  29. sameLine2: true,
  30. unit : "%",
  31. },
  32. {
  33. idx: "1499",
  34. //customTitle: "Cuisine",
  35. sameLine1: true,
  36. unit : "°C",
  37. },
  38. {
  39. idx: "1500",
  40. symbol: "fa fa-thermometer-half",
  41. customTitle: "Cuisine",
  42. sameLine2: true,
  43. unit : "%",
  44. },
  45. ]

Or (3rd example of the screenshot) :

  1. [
  2. {//first line : display the status of the heater occording to a boolean value
  3. idx: "228",
  4. symbolon: "fa fa-fire vert", //colors has to be defined on custom.css file
  5. symboloff: "fa fa-power-off rouge",
  6. boolean : true,
  7. customTitle: "Cuisine",
  8. },
  9. {// second line : display both thermostat mode
  10. //thermostat
  11. idx: "980",
  12. sameLine1: true,
  13. },
  14. {// and the thermostat target value
  15. //valeur de consigne
  16. idx: "966",
  17. sameLine2: true,
  18. unit : "°C",
  19. },
  20. {
  21. idx: "544",
  22. symbolon: "fa fa-fire vert",
  23. symboloff: "fa fa-power-off rouge",
  24. boolean : true,
  25. customTitle: "Salle Meca",
  26. },
  27. {
  28. //thermostat
  29. idx: "1262",
  30. sameLine1: true,
  31. },
  32. {
  33. //valeur de consigne
  34. idx: "1248",
  35. sameLine2: true,
  36. unit : "°C",
  37. },
  38. ]
  • HTTPS and HTTP is supported
  • you can define all the sensors you want
  • you can add several time the module in your Magic Mirror config and define a different updateInterval
  • symbol is based on Fontawesome
  • if you define the sensor as a “boolean:true” then you can :
    • add symbolon and symboloff depending on the sensor value (0 or 1)
    • add customTitleOn and customTitleOff depending on the sensor value (0 or 1)

Configuration Options

The following properties can be configured:



























































Option Description
updateInterval Update interval in ms


Possible values: int

Default value: 5000

Note: This value is in ms
jeedomAPIKey “Jeedom / paramétres / configuration / API . Activate the “Accès API JSONRPC” and take the API key globale of Jeedom

jeedomURL local or externe URL


Possible values: 192.168.1.18
jeedomPORT 443 or 80


Possible values: 443 or 80

Default value: 443
jeedomHTTPS HTTPS or HTTP


Possible values: boolean

Default value: true
animationSpeed Speed to animate the display during an update, in ms


Default value: 1000
displayLastUpdate If true this will display the last update time at the end of the task list. See screenshot above


Possible values: boolean

Default value: false
displayLastUpdateFormat Format to use for the time display if displayLastUpdate:true


Possible values: See Moment.js formats

Default value: ‘dd - HH:mm:ss’
sensors The list of sensor to be displayed, with extra config parameters :

  • idx: “1”, : Jeedom ID of the equipement to display. Can be found in “Resumé domotique”

  • symbol: “fa fa-tint”, : symbol to display if no other condition

  • symbolon: “fa fa-user”, : symbol to display when equipement is ON if “boolean : true,”

  • symboloff: “fa fa-user-o”, : symbol to display when equipement is OFF if “boolean : true,”

  • boolean : true, : if true, only the symbolon or symboloff is displayed

  • hiddenon: false, : info to hide if value is On

  • hiddenoff: false, : info to hide if value is Off

  • hideempty: false, : info to hide if value is Empty

  • customTitle: “No sensor define in config”, : Title of this sensor

  • customTitleOn: undefined, : Title to display when equipement is ON if “boolean : true,”. If customTitleOn is not set, customTitle is displayed

  • customTitleOff: undefined, : Title to display when equipement is OFF if “boolean : true,”. If customTitleOff is not set, customTitle is displayed

  • statuson: undefined, : Status to display when equipement is ON if “boolean : true,”. If statuson is not set, status from Jeedom sensor is displayed

  • statusoff: undefined, : Status to display when equipement is OFF if “boolean : true,”. If statusoff is not set, status from Jeedom is displayed

  • unit : “%”, : unit to display after the value of the sensor

  • sameLine1: false, : if true, it will be display on the same line than the “sameLine2: true”. Only the value and the unit can be defined in that case. See example above

  • sameLine2: false, : if true, it will be display on the same line than the “sameLine1: true”. The title and symbol define here will be used for both infos. See example above


Virtual_API This is the API key for update Virtual, you should find it on menu Params / System / API

TempID This is the command ID for virtual temperature information send to jeedom


Possible values: XXXX
HumID This is the command ID for virtual Humidity information send to jeedom


Possible values: XXXX

License

This project is licensed under the GPL License

Acknowledgments

Thank you very much to Mathias Arvidsson for his code and inspiration for MMM-Domoticz