[TUTO] [Prise Orvibo S20] script simple et efficace
[TUTO] [Prise Orvibo S20] script simple et efficace
Hello,
N’étant pas satisfait du plugin orvibo qui ne fonctionne pas correctement pour tout le monde pour les prises Orvibo S20
En promo à 9€ grâce a rosty il y a pas longtemps
J'a trouvé sur le net un script python qui permet entre autres de piloter les prises, j'ai apporté une petite modification et mis sur le market
Très simple il permet de créer un objet pour piloter ses prises :
0. Le plugin Orvibo All In One doit etre desactivé, celui-ci verouille le port nécéssaire pour piloter les prises
1. Suivre le tuto orvibo pour rajouter la prise a son réseau wifi
2. Donner au prise une IP fixe sur le DHCPd du routeur ou box ou ce qui vous sert a figer les IP's
3. Trouver et noter les IP's de vos prises
4. Créé un objet de type script par prises (vous devez avoir le plugin script !!)
5. Télécharger le script sur le market : Orvibo S20
6. Créer les commandes suivantes dans l'objet :
status = /usr/share/nginx/www/jeedom/plugins/script/core/ressources/S20control.py getstate <IP_OrviboS20> <MAC_OrviboS20>
off = /usr/share/nginx/www/jeedom/plugins/script/core/ressources/S20control.py poweroff <IP_OrviboS20> <MAC_OrviboS20>
on = /usr/share/nginx/www/jeedom/plugins/script/core/ressources/S20control.py poweron <IP_OrviboS20> <MAC_OrviboS20> * Adresse MAC au bon format xx:xx:xx:xx:xx
7. Associer un type générique par commandes en fonction de vos envies
Pour moi une lumière FIN
PS : il n'est pas nécessaire de répéter les actions, et l’état est correctement rafraîchi
PS2 : source du plugin : https://github.com/glenpp/OrviboS20
PS3 : Evolution future : détection auto
N’étant pas satisfait du plugin orvibo qui ne fonctionne pas correctement pour tout le monde pour les prises Orvibo S20
En promo à 9€ grâce a rosty il y a pas longtemps
J'a trouvé sur le net un script python qui permet entre autres de piloter les prises, j'ai apporté une petite modification et mis sur le market
Très simple il permet de créer un objet pour piloter ses prises :
0. Le plugin Orvibo All In One doit etre desactivé, celui-ci verouille le port nécéssaire pour piloter les prises
1. Suivre le tuto orvibo pour rajouter la prise a son réseau wifi
2. Donner au prise une IP fixe sur le DHCPd du routeur ou box ou ce qui vous sert a figer les IP's
3. Trouver et noter les IP's de vos prises
4. Créé un objet de type script par prises (vous devez avoir le plugin script !!)
5. Télécharger le script sur le market : Orvibo S20
6. Créer les commandes suivantes dans l'objet :
status = /usr/share/nginx/www/jeedom/plugins/script/core/ressources/S20control.py getstate <IP_OrviboS20> <MAC_OrviboS20>
off = /usr/share/nginx/www/jeedom/plugins/script/core/ressources/S20control.py poweroff <IP_OrviboS20> <MAC_OrviboS20>
on = /usr/share/nginx/www/jeedom/plugins/script/core/ressources/S20control.py poweron <IP_OrviboS20> <MAC_OrviboS20> * Adresse MAC au bon format xx:xx:xx:xx:xx
7. Associer un type générique par commandes en fonction de vos envies
Pour moi une lumière FIN
PS : il n'est pas nécessaire de répéter les actions, et l’état est correctement rafraîchi
PS2 : source du plugin : https://github.com/glenpp/OrviboS20
PS3 : Evolution future : détection auto
Dernière édition par cocapic le 20 nov. 2016, 18:17, édité 3 fois.
Pi3/SSD/Razberry/BLE/MiHome
9xDanfoss LC13 & 7xFGRM222 VR
7xFGK101 & 1xPSP01
1xSiren Gen5 2xFGBS001 3xFGS222 3x Philips Hue
4x tag BLE 3x Cam IP 5x Amazon Dash
9xDanfoss LC13 & 7xFGRM222 VR
7xFGK101 & 1xPSP01
1xSiren Gen5 2xFGBS001 3xFGS222 3x Philips Hue
4x tag BLE 3x Cam IP 5x Amazon Dash
Re: [TUTO] [Prise Orvibo S20] script simple et efficace
(reserved)
Pi3/SSD/Razberry/BLE/MiHome
9xDanfoss LC13 & 7xFGRM222 VR
7xFGK101 & 1xPSP01
1xSiren Gen5 2xFGBS001 3xFGS222 3x Philips Hue
4x tag BLE 3x Cam IP 5x Amazon Dash
9xDanfoss LC13 & 7xFGRM222 VR
7xFGK101 & 1xPSP01
1xSiren Gen5 2xFGBS001 3xFGS222 3x Philips Hue
4x tag BLE 3x Cam IP 5x Amazon Dash
Re: [TUTO] [Prise Orvibo S20] script simple et efficace
Merci pour ce partage.
Bien que j'adore les plugins de Lunarok, je reconnais que la duplication des commandes n'est pas toujours fiable (il m'est arrivé que des lumières restent allumées toute la journée alors que je répète 3 fois la commande). Du coup, je vais tester ce script.
Bien que j'adore les plugins de Lunarok, je reconnais que la duplication des commandes n'est pas toujours fiable (il m'est arrivé que des lumières restent allumées toute la journée alors que je répète 3 fois la commande). Du coup, je vais tester ce script.
Re: [TUTO] [Prise Orvibo S20] script simple et efficace
Je ne trouve pas le script (Orvibo S20) dans le market des scripts.
J'ai raté un détail ?
J'ai raté un détail ?
Re: [TUTO] [Prise Orvibo S20] script simple et efficace
Pareil, certains plugins de lunarok me sont indispensables, mais le coup de la lumière allumé toute la journée, c'est du vécu aussi ...Patator33 a écrit :Merci pour ce partage.
Bien que j'adore les plugins de Lunarok, je reconnais que la duplication des commandes n'est pas toujours fiable (il m'est arrivé que des lumières restent allumées toute la journée alors que je répète 3 fois la commande). Du coup, je vais tester ce script.
J'avais oublié de passer le plugin en stable, c'est fait desormais
++
Pi3/SSD/Razberry/BLE/MiHome
9xDanfoss LC13 & 7xFGRM222 VR
7xFGK101 & 1xPSP01
1xSiren Gen5 2xFGBS001 3xFGS222 3x Philips Hue
4x tag BLE 3x Cam IP 5x Amazon Dash
9xDanfoss LC13 & 7xFGRM222 VR
7xFGK101 & 1xPSP01
1xSiren Gen5 2xFGBS001 3xFGS222 3x Philips Hue
4x tag BLE 3x Cam IP 5x Amazon Dash
Re: [TUTO] [Prise Orvibo S20] script simple et efficace
merci pour le partage mais...j'ai ça comme erreur :
"Error on shell exec, return value : 1. Details : Array ( [0] => Traceback (most recent call last): File "/usr/share/nginx/www/jeedom/plugins/script/core/ressources/S20control.py", line 346, in control.poweron ( ip, mac ) File "/usr/share/nginx/www/jeedom/plugins/script/core/ressources/S20control.py", line 264, in poweron self._subscribeifneeded ( ip, mac ) File "/usr/share/nginx/www/jeedom/plugins/script/core/ressources/S20control.py", line 257, in _subscribeifneeded macasbin = ''.join ( [ struct.pack ( 'B', int(x,16) ) for x in mac.split ( ':' ) ] ) ValueError: invalid literal for int() with base 16: 'OC' )"
Du chinois pour moi, une idée ou ce situe mon erreur ????
Merci..
"Error on shell exec, return value : 1. Details : Array ( [0] => Traceback (most recent call last): File "/usr/share/nginx/www/jeedom/plugins/script/core/ressources/S20control.py", line 346, in control.poweron ( ip, mac ) File "/usr/share/nginx/www/jeedom/plugins/script/core/ressources/S20control.py", line 264, in poweron self._subscribeifneeded ( ip, mac ) File "/usr/share/nginx/www/jeedom/plugins/script/core/ressources/S20control.py", line 257, in _subscribeifneeded macasbin = ''.join ( [ struct.pack ( 'B', int(x,16) ) for x in mac.split ( ':' ) ] ) ValueError: invalid literal for int() with base 16: 'OC' )"
Du chinois pour moi, une idée ou ce situe mon erreur ????
Merci..
MERCI À L'ÉQUIPE POUR LE TAF
Re: [TUTO] [Prise Orvibo S20] script simple et efficace
Tu peux nous envoyé la commande en question
J'oubliais le plugin orvibo doit être désactivé
J'oubliais le plugin orvibo doit être désactivé
Pi3/SSD/Razberry/BLE/MiHome
9xDanfoss LC13 & 7xFGRM222 VR
7xFGK101 & 1xPSP01
1xSiren Gen5 2xFGBS001 3xFGS222 3x Philips Hue
4x tag BLE 3x Cam IP 5x Amazon Dash
9xDanfoss LC13 & 7xFGRM222 VR
7xFGK101 & 1xPSP01
1xSiren Gen5 2xFGBS001 3xFGS222 3x Philips Hue
4x tag BLE 3x Cam IP 5x Amazon Dash
Re: [TUTO] [Prise Orvibo S20] script simple et efficace
Merci pour le partage, je cherchais justement un moyen de gérer les lumières, mon prochain chantier
Sent from my Nexus 5X using Tapatalk
Sent from my Nexus 5X using Tapatalk
-
- Timide
- Messages : 3
- Inscription : 02 févr. 2017, 23:30
Re: [TUTO] [Prise Orvibo S20] script simple et efficace
Je ne trouve pas le script (Orvibo S20) dans le market des scripts? est ce normal?
j'ai donc installé le script "https://github.com/glenpp/OrviboS20" mais quand j'utilise la ligne de commande "getstate": j'ai le message d'erreur suivant "Error on shell exec, return value : 1. Details : Array ( [0] => )"
Merci pour votre aide
j'ai donc installé le script "https://github.com/glenpp/OrviboS20" mais quand j'utilise la ligne de commande "getstate": j'ai le message d'erreur suivant "Error on shell exec, return value : 1. Details : Array ( [0] => )"
Merci pour votre aide
- wipeout85800
- Timide
- Messages : 91
- Inscription : 05 sept. 2014, 06:47
Re: [TUTO] [Prise Orvibo S20] script simple et efficace
J'aime les pommes,pas toi?
-
- Timide
- Messages : 3
- Inscription : 02 févr. 2017, 23:30
Re: [TUTO] [Prise Orvibo S20] script simple et efficace
@ wipeout85800 Merci beaucoup,
Voici le message que j'ai quand je clique sur "installer stable" ou "supprimer":
"Echec de l'installation. Impossible de trouver le script "
Une idée pour dépanner
Merci
Voici le message que j'ai quand je clique sur "installer stable" ou "supprimer":
"Echec de l'installation. Impossible de trouver le script "
Une idée pour dépanner
Merci
- wipeout85800
- Timide
- Messages : 91
- Inscription : 05 sept. 2014, 06:47
Re: [TUTO] [Prise Orvibo S20] script simple et efficace
Le code du script qui devrai etre présent sur le market .....
Code : Tout sélectionner
#!/usr/bin/python
#
# Copyright (C) 2016 Glen Pitt-Pladdy
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
#
# See https://www.pitt-pladdy.com/blog/_20160121-103754_0000_Orvibo_S20_Wifi_Power_Socket_Utility/
# For original reverse engineering work see:
# https://stikonas.eu/wordpress/2015/02/24/reverse-engineering-orvibo-s20-socket/
# https://wiki.python.org/moin/UdpCommunication
import sys
import socket
import struct
import time
import pprint
# get args
def usage():
sys.stderr.write ( "Usage:\n" )
sys.stderr.write ( "\t%s connect <addr (fast blue broadcast 10.10.100.255)> <wlan ssid>\n" % (sys.argv[0]) )
sys.stderr.write ( "\t\t[ requires rapid flahsing blue / solid red (unconnected/connected) mode ]\n" )
sys.stderr.write ( "\t%s discover <broadcast addr> <MAC>\n" % (sys.argv[0]) )
sys.stderr.write ( "\t%s globaldiscover <broadcast addr>\n" % (sys.argv[0]) )
sys.stderr.write ( "\t%s _subscribe <addr> <MAC>\n" % (sys.argv[0]) )
sys.stderr.write ( "\t%s gestate <addr> <MAC>\n" % (sys.argv[0]) )
sys.stderr.write ( "\t%s poweron <addr> <MAC>\n" % (sys.argv[0]) )
sys.stderr.write ( "\t%s poweroff <addr> <MAC>\n" % (sys.argv[0]) )
sys.stderr.write ( "\t%s listen\n" % (sys.argv[0]) )
sys.exit ( 1 )
if len ( sys.argv ) >= 2:
command = sys.argv[1]
if command == 'connect':
if len ( sys.argv ) != 4: usage()
ip = sys.argv[2] # barodcast address to use
wlan = sys.argv[3]
elif command in [ 'discover', '_subscribe', 'getstate', 'poweron', 'poweroff' ]:
if len ( sys.argv ) != 4: usage()
ip = sys.argv[2] # barodcast address to use
mac = sys.argv[3]
elif command == 'globaldiscover':
if len ( sys.argv ) != 3: usage()
ip = sys.argv[2] # barodcast address to use
elif command == 'listen':
if len ( sys.argv ) != 2: usage()
else:
usage()
else:
usage()
# main class for Orvibo S20
class orviboS20:
port = 10000
class UnknownPacket(Exception):
def __init__ (self,value):
self.value = value
def __str__ (self):
return repr(self.value)
def __init__ ( self ):
self.subscribed = None
self.exitontimeout = False
# TODO get a lock (file lock?) for port 10000 TODO
# get a connection sorted
self.sock = socket.socket (
socket.AF_INET, # Internet
socket.SOCK_DGRAM # UDP
)
self.sock.setsockopt ( socket.SOL_SOCKET, socket.SO_BROADCAST, 1 ) # https://stackoverflow.com/questions/11457676/python-socket-error-errno-13-permission-denied
self.sock.bind ( ('',self.port) )
def _settimeout ( self, timeout = None ):
self.sock.settimeout ( timeout ) # seconds - in reality << 1 is needed, None = blocking (wait forever)
# takes payload excluding first 4 (magic, size) bytes
def _sendpacket ( self, payload, ip ):
data = [ 0x68, 0x64, 0x00, len(payload)+4 ]
data.extend ( payload )
# print data
self.sock.sendto ( ''.join([ struct.pack ( 'B', x ) for x in data ]), ( ip, 10000 ) )
def _listendiscover ( self ):
status = {
'exit': True,
'timeout': False,
'detail': {},
}
if self.exitontimeout: status['exit'] = False # we should wait for timeout, not just exit
# we need to run and catch timeouts
try:
data,addr = self.sock.recvfrom ( 1024 )
# check magic for a valid packet
if data[0:2] != 'hd':
return None
# decode
status['address'],status['port'] = addr
status['detail']['length'] = struct.unpack ( '>H', data[2:4] )[0]
status['detail']['commandid'] = struct.unpack ( '>H', data[4:6] )[0]
# print "Length: %d" % status['detail']['length']
# print "commandid: 0x%04x" % status['detail']['commandid']
# then based on the lenth / command we can expect different stuff
if status['detail']['length'] == 6 and status['detail']['commandid'] == 0x7161:
# already got everything
# global discovery - we probably sent this
# print "command: Global Discovery"
status['command'] = 'Global Discovery'
status['exit'] = False # expect more after this
elif status['detail']['length'] == 18 and status['detail']['commandid'] == 0x7167:
# discovery - we probably sent this
# print "command: Discovery"
status['command'] = 'Discovery'
status['exit'] = False # expect more after this
# get remaining stuff
status['detail']['dstmac'] = struct.unpack ( '6B', data[6:12] )
status['detail']['srcmac'] = struct.unpack ( '6B', data[12:18] )
# print "mac: %s" % ':'.join( [ '%02x' % c for c in status['detail']['dstmac'] ] )
# print "padding: %s" % ':'.join( [ '%02x' % c for c in status['detail']['srcmac'] ] )
elif status['detail']['length'] == 42 and ( status['detail']['commandid'] == 0x7161 or status['detail']['commandid'] == 0x7167 ):
# returned discovery
# print "command: Discovery (response)"
status['command'] = 'Discovery (response)'
# get remaining stuff
zero = struct.unpack ( '>B', data[6:7] )[0]
if zero != 0: sys.stderr.write ( "WARNING: [0] zero = 0x%02x\n" % zero )
status['detail']['dstmac'] = struct.unpack ( '6B', data[7:13] )
status['detail']['srcmac'] = struct.unpack ( '6B', data[13:19] )
dstmacr = struct.unpack ( '6B', data[19:25] )
srcmacr = struct.unpack ( '6B', data[25:31] )
# print "mac: %s" % ':'.join( [ '%02x' % c for c in status['detail']['dstmac'] ] )
# print "padding: %s" % ':'.join( [ '%02x' % c for c in status['detail']['srcmac'] ] )
status['detail']['soc'] = data[31:37]
# print "soc: %s" % status['detail']['soc']
status['detail']['timer'] = struct.unpack ( 'I', data[37:41] )[0]
# print "1900+sec: %d" % status['detail']['timer']
status['state'] = struct.unpack ( 'B', data[41] )[0]
# print "state: %d" % status['state']
elif status['detail']['length'] == 24 and status['detail']['commandid'] == 0x636c:
# returned subscription TODO separate this - we should only be looking for subscription related stuff after and not tricked by other (discovery) stuff
status['detail']['dstmac'] = struct.unpack ( '6B', data[6:12] )
status['detail']['srcmac'] = struct.unpack ( '6B', data[12:18] )
# print "mac: %s" % ':'.join( [ '%02x' % c for c in status['detail']['dstmac'] ] )
# print "padding: %s" % ':'.join( [ '%02x' % c for c in status['detail']['srcmac'] ] )
zero = struct.unpack ( '>5B', data[18:23] )
for i in range(5):
if zero[i] != 0: sys.stderr.write ( "WARNING: [1] zero[%d] = 0x%02x\n" % (i,zero) )
status['state'] = struct.unpack ( 'B', data[23] )[0]
# print "state: %d" % status['state']
elif status['detail']['length'] == 23 and status['detail']['commandid'] == 0x6463:
# returned power on/off TODO separate this - we should only be looking for subscription related stuff after and not tricked by other (discovery) stuff
status['detail']['dstmac'] = struct.unpack ( '6B', data[6:12] )
status['detail']['srcmac'] = struct.unpack ( '6B', data[12:18] )
# print "mac: %s" % ':'.join( [ '%02x' % c for c in status['detail']['dstmac'] ] )
# print "padding: %s" % ':'.join( [ '%02x' % c for c in status['detail']['srcmac'] ] )
status['detail']['peercount'] = struct.unpack ( 'B', data[18] ) # number of peers on the network
zero = struct.unpack ( '>4B', data[19:23] )
for i in range(4):
if zero[i] != 0: sys.stderr.write ( "WARNING: [2] zero[%d] = 0x%02x\n" % (i,zero[i]) )
# previous info said 4 bytes zero, 5th state, but on my S20 this is always zero, so assume as above 5 bytes zero, no state
else:
raise UnknownPacket
except socket.timeout:
# if we are doing timeouts then just catch it - it's probably for a reason
status['timeout'] = True
if self.exitontimeout: status['exit'] = True
except UnknownPacket, e: # TODO this should be more specific to avoid trapping syntax errors
sys.stderr.write ( "Error: %s:\n" % e )
sys.stderr.write ( "Unknown packet:\n" )
for c in struct.unpack ( '%dB' % len(data), data ):
sys.stderr.write ( "* %02x \"%s\"\n" % (c,chr(c)) )
return status
def listen ( self ):
self._settimeout ( None ) # set blocking
self.exitontimeout = False
return self._listendiscover ()
def discover ( self, ip, mac ):
self._settimeout ( 2 )
self.exitontimeout = True
# macasbin = ''.join ( [ struct.pack ( 'B', int(x,16) ) for x in mac.split ( ':' ) ] )
# self.sock.sendto ( 'hd\x00\x12\x71\x67'+macasbin+' ' , ( ip, 10000 ) )
data = [ 0x71, 0x67 ]
data.extend ( [ int(x,16) for x in mac.split ( ':' ) ] )
data.extend ( [ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 ] )
self._sendpacket ( data, ip )
data = []
while True:
resp = self._listendiscover ()
data.append ( resp )
if resp['exit']: break
return data
def globaldiscover ( self, ip ):
self._settimeout ( 2 )
self.exitontimeout = True
# self.sock.sendto ( 'hd\x00\x06\x71\x61' , ( ip, 10000 ) )
self._sendpacket ( [ 0x71, 0x61 ], ip )
data = []
while True:
resp = self._listendiscover ()
data.append ( resp )
if resp['exit']: break
return data
def subscribe ( self, ip, mac ):
self._settimeout ( 2 )
self.exitontimeout = True
data = [ 0x63, 0x6c ]
data.extend ( [ int(x,16) for x in mac.split ( ':' ) ] )
data.extend ( [ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 ] )
data.extend ( [ int(x,16) for x in reversed ( mac.split ( ':' ) ) ] )
data.extend ( [ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 ] )
self._sendpacket ( data, ip )
resp = self._listendiscover ()
self.subscribed = [
resp['address'],
''.join ( [ struct.pack ( 'B', x ) for x in resp['detail']['dstmac'] ] ),
# ':'.join ( [ "%02x" % x for x in resp['detail']['dstmac'] ] )
[ x for x in resp['detail']['dstmac'] ]
]
time.sleep ( 0.01 ) # need a delay >6ms to be reliable - comands before that may be ignored
return resp
def _subscribeifneeded ( self, ip, mac ):
if mac == None and self.subscribed != None:
# already subscribed
pass
elif ip != None and mac != None:
# subscribe or check existing subscription
macasbin = ''.join ( [ struct.pack ( 'B', int(x,16) ) for x in mac.split ( ':' ) ] )
if self.subscribed == None or self.subscribed[1] != macasbin:
# new subscription / re-subscription
self.subscribe ( ip, mac )
if self.subscribed == None or self.subscribed[1] != macasbin:
raise # something failed
def poweron ( self, ip = None, mac = None ):
self._subscribeifneeded ( ip, mac )
# we should now be subscribed - go ahead with the power command
data = [ 0x64, 0x63 ]
data.extend ( self.subscribed[2] )
data.extend ( [ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x01 ] )
self._sendpacket ( data, self.subscribed[0] )
resp = self._listendiscover ()
# pprint.pprint ( resp )
return resp
def poweroff ( self, ip = None, mac = None ):
self._subscribeifneeded ( ip, mac )
# we should now be subscribed - go ahead with the power command
data = [ 0x64, 0x63 ]
data.extend ( self.subscribed[2] )
data.extend ( [ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00 ] )
self._sendpacket ( data, self.subscribed[0] )
resp = self._listendiscover ()
# pprint.pprint ( resp )
return resp
if command == 'connect':
sock = socket.socket (
socket.AF_INET, # Internet
socket.SOCK_DGRAM # UDP
)
sock.setsockopt ( socket.SOL_SOCKET, socket.SO_BROADCAST, 1 ) # https://stackoverflow.com/questions/11457676/python-socket-error-errno-13-permission-denied
sock.settimeout ( 2 ) # seconds - in reality << 1 is needed
# connect to network
sock.sendto ( 'HF-A11ASSISTHREAD' , (ip,48899) )
data,addr = sock.recvfrom ( 1024 )
socketip,socketmac,sockethost = data.split ( ',' )
print socketip,socketmac,sockethost
sock.sendto ( '+ok' , (ip,48899) ) # ack
sock.sendto ( "AT+WSSSID=%s\r" % wlan, (ip,48899) )
data,addr = sock.recvfrom ( 1024 )
if data.rstrip() != '+ok':
sys.exit ( "FATAL - got \"%s\" in response to set SSID\n" % data.rstrip() )
key = raw_input ( "Enter WIFI key for \"%s\": " % wlan )
sock.sendto ( "AT+WSKEY=WPA2PSK,AES,%s\r" % key, (ip,48899) )
data,addr = sock.recvfrom ( 1024 )
if data.rstrip() != '+ok':
sys.exit ( "FATAL - got \"%s\" in response to set KEY\n" % data.rstrip() )
sock.sendto ( "AT+WMODE=STA\r" , (ip,48899) )
data,addr = sock.recvfrom ( 1024 )
if data.rstrip() != '+ok':
sys.exit ( "FATAL - got \"%s\" in response to set MODE\n" % data.rstrip() )
sock.sendto ( "AT+Z\r" , (ip,48899) ) # no return
print "connect complete to \"%s\"" % wlan
elif command == 'listen': # listen for stuff sent round
print "listen"
control = orviboS20 ()
while True:
resp = control.listen ()
pprint.pprint ( resp )
if resp['exit']: break
elif command == 'discover':
control = orviboS20 ()
resp = control.discover ( ip, mac )
pprint.pprint ( resp )
elif command == 'globaldiscover':
control = orviboS20 ()
resp = control.globaldiscover ( ip )
pprint.pprint ( resp )
elif command == '_subscribe':
control = orviboS20 ()
resp = control.subscribe ( ip, mac )
pprint.pprint ( resp )
elif command == 'getstate':
control = orviboS20 ()
resp = control.subscribe ( ip, mac )
pprint.pprint ( resp['state'] )
elif command == 'poweron':
control = orviboS20 ()
control.poweron ( ip, mac )
elif command == 'poweroff':
control = orviboS20 ()
control.poweroff ( ip, mac )
# TODO TABLE DATA
# TODO SOCKET DATA
# TODO Timing DATA
J'aime les pommes,pas toi?
-
- Timide
- Messages : 3
- Inscription : 02 févr. 2017, 23:30
Re: [TUTO] [Prise Orvibo S20] script simple et efficace
@ wipeout85800 merci
ça marche nickel maintenant
ça marche nickel maintenant
Re: [TUTO] [Prise Orvibo S20] script simple et efficace
Hello,
j'avais apporté une modif sur les retours (code sortie) du script, je sais pas si la version que tu donnes wipeout85800 est ma version ou celle de l'auteur originel ?
@homecineseb, l'installation devrais marcher, je regarderais ca
++
j'avais apporté une modif sur les retours (code sortie) du script, je sais pas si la version que tu donnes wipeout85800 est ma version ou celle de l'auteur originel ?
@homecineseb, l'installation devrais marcher, je regarderais ca
++
Pi3/SSD/Razberry/BLE/MiHome
9xDanfoss LC13 & 7xFGRM222 VR
7xFGK101 & 1xPSP01
1xSiren Gen5 2xFGBS001 3xFGS222 3x Philips Hue
4x tag BLE 3x Cam IP 5x Amazon Dash
9xDanfoss LC13 & 7xFGRM222 VR
7xFGK101 & 1xPSP01
1xSiren Gen5 2xFGBS001 3xFGS222 3x Philips Hue
4x tag BLE 3x Cam IP 5x Amazon Dash
- wipeout85800
- Timide
- Messages : 91
- Inscription : 05 sept. 2014, 06:47
Re: [TUTO] [Prise Orvibo S20] script simple et efficace
@Cocapic, c'est la version que tu avais partagée via le market à la date de création de ton post.
Bonne journée
Bonne journée
J'aime les pommes,pas toi?
Re: [TUTO] [Prise Orvibo S20] script simple et efficace
oui donc c'est bon
Pi3/SSD/Razberry/BLE/MiHome
9xDanfoss LC13 & 7xFGRM222 VR
7xFGK101 & 1xPSP01
1xSiren Gen5 2xFGBS001 3xFGS222 3x Philips Hue
4x tag BLE 3x Cam IP 5x Amazon Dash
9xDanfoss LC13 & 7xFGRM222 VR
7xFGK101 & 1xPSP01
1xSiren Gen5 2xFGBS001 3xFGS222 3x Philips Hue
4x tag BLE 3x Cam IP 5x Amazon Dash
-
- Timide
- Messages : 14
- Inscription : 24 févr. 2017, 19:29
Re: [TUTO] [Prise Orvibo S20] script simple et efficace
Bonjour Copapic,
J'ai modifié le plugin Orvibo pour avoir la même fiabilité que par ton script Python.
Ca a l'avantage de donner l'accès au Orbivo Allone, mais aussi de laisser faire le script pour l'association automatique
Je vais voir avec Lunarok s'il peut intégrer mes modifications
J'ai modifié le plugin Orvibo pour avoir la même fiabilité que par ton script Python.
Ca a l'avantage de donner l'accès au Orbivo Allone, mais aussi de laisser faire le script pour l'association automatique
Je vais voir avec Lunarok s'il peut intégrer mes modifications
Re: [TUTO] [Prise Orvibo S20] script simple et efficace
Good job , no prob j'y suis pas pour grand chose moi ...
Et le résultat devrait être le top
Envoyé de mon iPhone en utilisant Tapatalk
Et le résultat devrait être le top
Envoyé de mon iPhone en utilisant Tapatalk
Pi3/SSD/Razberry/BLE/MiHome
9xDanfoss LC13 & 7xFGRM222 VR
7xFGK101 & 1xPSP01
1xSiren Gen5 2xFGBS001 3xFGS222 3x Philips Hue
4x tag BLE 3x Cam IP 5x Amazon Dash
9xDanfoss LC13 & 7xFGRM222 VR
7xFGK101 & 1xPSP01
1xSiren Gen5 2xFGBS001 3xFGS222 3x Philips Hue
4x tag BLE 3x Cam IP 5x Amazon Dash
Re: [TUTO] [Prise Orvibo S20] script simple et efficace
Bonjour,
installé le script, j'essaye de créer un script pour ma première prise 20 et j'ai ce message d'erreur sur la ligne status (le plugin orvibo est desactivé)
Error on shell exec, return value : 2. Details : Array ( [0] => python: can't open file '/usr/share/nginx/www/jeedom/plugins/script/core/ressources/S20control.py': [Errno 2] No such file or directory )
Comment corriger
installé le script, j'essaye de créer un script pour ma première prise 20 et j'ai ce message d'erreur sur la ligne status (le plugin orvibo est desactivé)
Error on shell exec, return value : 2. Details : Array ( [0] => python: can't open file '/usr/share/nginx/www/jeedom/plugins/script/core/ressources/S20control.py': [Errno 2] No such file or directory )
Comment corriger
1x Nuc I3 cible / Stick Aeon Gen5 / +- 30 modules Zwave / 7 cameras (Surveillance station)
1 x RPi2 source / Teleinfo USB
1 x Odroid C2 / Stick Aeon Gen 5 / 10 modules Zwave
1 x RPi2 source / Teleinfo USB
1 x Odroid C2 / Stick Aeon Gen 5 / 10 modules Zwave
Re: [TUTO] [Prise Orvibo S20] script simple et efficace
Tu as verifier que le fichier est bien à l'emplacement donné ?
Pi3/SSD/Razberry/BLE/MiHome
9xDanfoss LC13 & 7xFGRM222 VR
7xFGK101 & 1xPSP01
1xSiren Gen5 2xFGBS001 3xFGS222 3x Philips Hue
4x tag BLE 3x Cam IP 5x Amazon Dash
9xDanfoss LC13 & 7xFGRM222 VR
7xFGK101 & 1xPSP01
1xSiren Gen5 2xFGBS001 3xFGS222 3x Philips Hue
4x tag BLE 3x Cam IP 5x Amazon Dash
Qui est en ligne ?
Utilisateurs parcourant ce forum : Aucun utilisateur inscrit et 15 invités