Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New device types added #22

Open
wants to merge 99 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
90e67c8
adding features: DryContacts, Alarm, PowerMeters, SetTime and more
simont77 Apr 17, 2017
5021d51
added Eve-like history to Energy
Aug 10, 2017
61c4096
cleanup
Aug 10, 2017
2264904
average power every 10min and fix of entry length
Aug 10, 2017
38c9fc1
added accessory type in logging of history
Aug 11, 2017
f9fdea1
fix to make history more reliable with multiple iOS devices
Aug 11, 2017
76ca76e
moved fakegato_history outside for reuse with other plugins
Sep 8, 2017
388ed0a
use of setCorrectingInternal to improve time accuracy of historical d…
simont77 Oct 9, 2017
632eb66
dependencies update
simont77 Oct 10, 2017
fde9156
fix
simont77 Oct 10, 2017
969f7df
fix
simont77 Oct 10, 2017
f0aa114
fix
simont77 Oct 10, 2017
edfd3a1
moved accumulation of power into setCorrectingInterval call to improv…
simont77 Oct 13, 2017
1b04b41
fix dimmer levels, version bump
simont77 Oct 22, 2017
9b84ee5
Update package.json
simont77 Dec 20, 2017
0d11209
history added for motion and door
simont77 Jan 7, 2018
e5d0aa7
added programmable duration to motion
simont77 Jan 8, 2018
0dff48f
cleanup
Jan 9, 2018
e08e996
cleanup
Jan 9, 2018
2da6efb
added firmwareRevision from package.json
Jan 9, 2018
0d28207
fix AccessoryInfo
Jan 9, 2018
0520744
fix
simont77 Jan 9, 2018
e21a685
update dependencies
simont77 Jan 9, 2018
8bfc5b0
add entry on startup in motion and door
simont77 Jan 14, 2018
d08dd1e
update dependencies
Jan 16, 2018
c06ee5e
added last detection in motion and door
simont77 Jan 20, 2018
471ec1d
update dependencies
simont77 Jan 23, 2018
f964b4e
caching reset time for door and motion
Jan 24, 2018
712880f
fix motion update state and added fakegatoStorage
simont77 Jan 27, 2018
41ece03
jslint validation
Jan 29, 2018
e0a75b3
get initialTime from fakegato
simont77 Jan 31, 2018
a264e2c
moved average power calculation to fakegato
simont77 Feb 1, 2018
b37ab8f
update pedencencies
simont77 Feb 7, 2018
d2034b6
update dependencies
simont77 Feb 7, 2018
a7c427a
initial addition of MHIrrigation
simont77 Feb 14, 2018
c13999e
added control of remaining time, still to be fixed
simont77 Feb 14, 2018
4d94e37
optimized remaining duration control
simont77 Feb 15, 2018
39ada95
removed unused dependencies
simont77 Feb 16, 2018
1266f0d
update readme and sample_config.json
simont77 Feb 16, 2018
dc38f9a
Update README.md
simont77 Feb 16, 2018
47957f2
Update README.md
simont77 Feb 16, 2018
4547d7d
update sample_config.json
simont77 Feb 16, 2018
87ffdb9
fix and cleanup
simont77 Feb 18, 2018
b437ead
fix for lastOpening/lastActivation
simont77 Mar 15, 2018
5d2750d
Merge branch 'master' into adding_irrigation
simont77 Mar 15, 2018
1f7500d
Update package.json
simont77 Mar 16, 2018
bc81c93
- added optional storage parameter. If "fs" will persist history on f…
simont77 Apr 13, 2018
c4af03d
Merge branch 'master' into adding_irrigation
simont77 Apr 13, 2018
b990c27
removed useless timer, set duration of startup, shutdown homekit time…
simont77 Apr 14, 2018
9906312
set back timer to guarantee correct countdown when app is close
simont77 Apr 15, 2018
09c4079
fix
simont77 Apr 15, 2018
409a83e
save last activation, number opening, last reset for door/motion usin…
simont77 Apr 16, 2018
8504423
save total consumption and last reset for energy using fakegato
simont77 Apr 17, 2018
fe94894
version bump
simont77 Apr 17, 2018
b51cdcc
added history to irrigation using "motion", just to show last activat…
simont77 Apr 18, 2018
957124a
update fakegato dependencies
simont77 Apr 19, 2018
dd371a7
fix
simont77 Apr 22, 2018
8319703
default googledrive persistance for irrigation
simont77 Apr 22, 2018
8941e34
fix for not overloading the gateway
simont77 Apr 22, 2018
5ecb886
fix for timed relay command
simont77 Apr 22, 2018
3ba3b9f
fix for persistance of total energy
simont77 Apr 24, 2018
d9dfb69
check if history was loaded for energy before setting extra persisted…
simont77 Apr 27, 2018
74f1096
fix
simont77 Apr 29, 2018
27908f9
Merge branch 'saving-additional-historical-data'
simont77 Apr 29, 2018
b362b64
update fakegato dependency
simont77 Apr 29, 2018
41407cc
0.1.9
simont77 Apr 29, 2018
5c1d25f
disable fakegato timer for irrigation
simont77 May 5, 2018
6128462
0.1.10
simont77 May 5, 2018
0665c72
support for scenario enable/disable commands
simont77 May 15, 2018
5048fd3
added MHScenario class and support
simont77 May 19, 2018
2f14ac3
0.1.11
simont77 May 19, 2018
793bb9a
prettify
simont77 May 19, 2018
c9c8f48
update MHScenario with both Active and Esegui
simont77 May 20, 2018
8b94521
0.1.12
simont77 May 20, 2018
94cbdf6
initial support to irrigation history (stil to be fixed)
simont77 Jun 26, 2018
c6140b6
fix to irrigation serial number
simont77 Jun 27, 2018
c99b785
adding extra char for irrigation, work in progress
simont77 Jun 28, 2018
4b5a18e
complete adding extra char for irrigation
simont77 Jun 28, 2018
6f20c5b
fix typos
simont77 Jul 4, 2018
efc5456
fix for waterFlux
simont77 Jul 4, 2018
7eb6829
update package.json
simont77 Jul 6, 2018
b247934
fix to avoid multiple timer creation in MHIrragation
simont77 Jul 6, 2018
a81dc5d
0.1.13
simont77 Jul 11, 2018
70cbb3e
fix to improve reliability of reading of extra data from persistent s…
simont77 Jul 17, 2018
fb17b0c
0.1.14
simont77 Jul 17, 2018
d869657
fix for alarm status
simont77 Aug 10, 2018
7eb4b65
fix alarm status
simont77 Sep 1, 2018
9647630
initial support for reset of total water usage for aqua
simont77 Sep 30, 2018
d6ccb49
fix PowerMeter for Eve 3.8.1 compatibility
simont77 Sep 7, 2019
52ab5ab
0.1.15, update fakegato dependency
simont77 Sep 7, 2019
dd5313c
fix regex for alarm status
simont77 Sep 8, 2019
5141295
0.1.16
simont77 Sep 8, 2019
a36516d
fix blind partial opening
simont77 Apr 16, 2020
75f3880
cleanup
simont77 Apr 16, 2020
501f838
fix blind timer
simont77 Apr 21, 2020
a86bb2b
0.1.17
simont77 Apr 21, 2020
d9f775c
update depencencies
simont77 Apr 30, 2020
7b32ffb
0.1.18
simont77 Apr 30, 2020
6745ec7
update fakegato dep
simont77 Nov 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
MIT License

Copyright (c) 2016 angeloxx
Copyright (c) 2017 Simone Tisa


Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
101 changes: 22 additions & 79 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
# MyHomePlugin
Legrand (BTicino) MyHome plugin for homebridge: https://github.com/nfarina/homebridge
Legrand (BTicino) MyHome plugin for homebridge: https://github.com/nfarina/homebridge This is a fork of https://github.com/angeloxx/homebridge-myhome, with added accessories and support for Elgato Eve history feature for contact, motion sensor and powermeter.

Legrand MyHome (http://www.homesystems-legrandgroup.com/BtHomeSystems/home.action) is an Home Automation solution that can manage:
- lighting (standard on/off/dimmed lights)
- thermoregulation
- curtains, doors
- security systems
- contact and motion sensors

With this plugin, the support of a IP gateway installed in your plant and a configuration of all installed
systems (MyHome does not support the autodiscovery of the system) you can control it. You need to disable the OpenWebNet password-based
authentication from the IP of the device that runs homebridge (ie. Raspberry) or set the auhentication to HMAC;
HMAC authentication is supported by all recent IP gateways or older one with updated firmware (eg. F454 with v2 firmware).

# Installation (TBD)
Install plugin with npm install -g homebridge-myhome
# Installation
Install plugin with `npm install -g simont77/homebridge-myhome`
Add platform within config.json of you homebridge instance:

{
"platforms": [{
"platform": "MyHome Gateway",
"ipaddress": "192.168.1.1",
"password": "12345",
"discovery": false,
"setclock": true,
"devices": [
/*Static list of devices*/
]
Expand All @@ -36,18 +37,7 @@ Add platform within config.json of you homebridge instance:
"accessories": []
}

Restart homebridge
Enjoy!

# Installation

Run as root:

npm -g install homebridge-myhome-tng

Create your config.json file starting from the template (sample-config.json) and then:

homebridge -U .
Restart homebridge.

Sample log is:

Expand Down Expand Up @@ -88,67 +78,22 @@ Sample log is:

## Configuration

Only the platforms section of the config.json file should be edited, the pair code and the port in bridge section can be ignored in most of the cases. A little sample:

{
"platforms": [{
"platform": "LegrandMyHome",
"ipaddress": "192.168.157.207",
"port": 20000,
"ownpassword": "12345",
"discovery": false,
"devices": [{
"accessory": "MHRelay",
"name": "Bathroom Light",
"address": "0/1/5"
},{
"accessory": "MHRelay",
"name": "Night hallway Light",
"address": "0/1/1"
},{
"accessory": "MHRelay",
"name": "Office",
"address": "0/1/4"
},{
"accessory": "MHDimmer",
"name": "Master bedroom Central",
"address": "0/1/2"
},{
"accessory": "MHThermostat",
"name": "Living Room Thermostat",
"address": "21"
},{
"accessory": "MHThermostatExternal",
"name": "External Thermo Sensor",
"address": "1"
}]
}],
"bridge": {
"username": "CC:22:3D:E3:CE:31",
"name": "MyHome HomeBridge Adapter",
"pin": "342-52-220",
"port": 51827
},
"description": "My MyHome Home System",
"accessories": [
]
}

Only the platforms section of the config.json file should be edited, the pair code and the port in bridge section can be ignored in most of the cases.
The first part of the config file contains details about the MyHome Gateway used to interface the IP network with the plant:

"platforms": [{
"platform": "LegrandMyHome",
"ipaddress": "192.168.157.207",
"port": 20000,
"ownpassword": "12345",
"discovery": false,
"setclock": true,
"devices": [{

You need to change:
- ipaddress: put the IP address or name of the MyHome Gateway (eg. F454 or MH201, I'm not so updated about all gateways that BTicino-Legrand releases after 2015); the IP should be static but in the future I can implement a UPNP dicovery because all gateways supports that method
- ipaddress: put the IP address or name of the MyHome Gateway (eg. F454 or MH201)
- port: should be 20000 and keep this value
- ownpassword: the OpenWebNet password, default is 12345 but everyone will suggest to you to change it with another password (4 to 9 digits), but you will keep the default one, I know...
- discovery: boolean value, not supported but in the future allows the gateway to discover the plant and detect most of devices
- setclock: set to true if you want your homebridge server to set the time of your gateway every hour
- devices: list of installed devices

The devices section contains the list of devices that will be managed. All devices contains three standard properties:
Expand All @@ -159,8 +104,7 @@ The devices section contains the list of devices that will be managed. All devic

## Supported devices

* MHRelay: Standard (Lighting) Relay (eg. F411), address is B/A/PL (eg. 0/1/10)
* this device supports the definition of a custom frame for on and off command, so you can specify frame\_on and/or frame\_off:
* MHRelay: Standard (Lighting) Relay (eg. F411), address is B/A/PL (eg. 0/1/10). This device supports the definition of a custom frame for on and off command, so you can specify frame\_on and/or frame\_off:

{
"accessory": "MHRelay",
Expand All @@ -180,12 +124,18 @@ The devices section contains the list of devices that will be managed. All devic
* MHBlind: Standard Automation Relay (eg. F411, I need to check the F401), address is B/A/PL (eg. 0/1/10)
* this device defines another property called "time" that defines the configured "stop time" in seconds; using this property the driver can evaluate the current position of the blind
* MHBlindAdvanced: Advanced version of standard Blind (eg. F401 that manages internally the current position), address is B/A/PL (eg. 0/1/10)
* MHContactSensor: Dry Contact sensor (eg. 3477 or some burgalarm sensors), address range is 1-201
* MHPowerMeter: (WILL BE SUPPORTED)
* MHAlarm: (WILL BE SUPPORTED)
* MHContactSensor: Dry Contact sensor (eg. 3477 or some burgalarm sensors), address range is 1-201. Supported types are "motion" and "contact". Elgato Eve history feature is supported.
* MHPowerMeter: Only supported with F421 Load Control Central, use "refresh" to set the update interval. Elgato Eve history feature is supported.
* MHAlarm: tested on central 3486. Zones for Away, Night and At Home activation are currently hard coded in plugin code. Alarm activation/deactivation from Homekit is not implemented for security reasons, so only monitor of the current status is supported
* MHTimedRelay: to issue temporized command to relays. Default duration set in "duration"
* MHControlledLoad: to control status of old generation Load Control outlets
* MHAux: to deliver AUX events to Homekit. Supported type are "leak", "gas" and contact".
* MHIrrigation: modified MHTimedRelay using the new Homekit irrigation service

See sample-config.json for the additional parameters of each accessory.

## Tested devices
- F454v1 and MH201 as IP Gateway
- F454v1, MH200N and MH201 as IP Gateway
- F411/2 as MHRelay, MHOutlet and MHCurtain
- F401 as MHBlindAdvanced
- F416U1 as MHDimmer
Expand All @@ -196,15 +146,8 @@ The devices section contains the list of devices that will be managed. All devic

- Groups are not managed

# TODOS

- Reconnection and infinite retry
- Semi-auto discovery and/or read a plant configuration from MyHomeSuite configuration file
- Re-order the code
- IP Gateway discovery
- Group and General Command support

# Disclaimer

I'm furnishing this software "as is". I do not provide any warranty of the item whatsoever, whether express, implied, or statutory, including, but not limited to, any warranty of merchantability or fitness for a particular purpose or any warranty that the contents of the item will be error-free.
The development of this module is not supported by Legrand, BTicino or Apple. These vendors and me are not responsible for direct, indirect, incidental or consequential damages resulting from any defect, error or failure to perform.
The development of this module is not supported by Legrand, BTicino or Apple. These vendors and me are not responsible for direct, indirect, incidental or consequential damages resulting from any defect, error or failure to perform.
Loading