Welcome to Domotique-fibaro

 

Inscrivez-vous maintenant pour accéder à toutes nos fonctionnalités. Une fois inscrit et connecté, vous serez en mesure de contribuer à ce site en soumettant votre propre contenu ou en répondant au contenu existant. Vous serez en mesure de personnaliser votre profil, de recevoir des points de réputation comme une récompense pour la soumission de contenu, tout en communiquant avec d'autres membres via votre boîte de réception privée, et bien plus encore! Ce message sera supprimé une fois que vous vous êtes connecté.

 

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

drboss

Membres confirmés
  • Compteur de contenus

    42
  • Inscription

  • Dernière visite

Réputation sur la communauté

17 Good

À propos de drboss

  • Rang
    Nouveau

Profile Information

  • Sexe :
    Homme
  • Ville :
    Varsovie
  • Box
    Home Center 2
    Home Center Lite
    Autre
  • Version
    4.111b

Visiteurs récents du profil

181 visualisations du profil
  1. Tuto HC2

    Merci @pepite Je rattrape le temps quand je n'avais aucun accès à HC2. ( Des chirurgiens opéraient ma colonne vertébrale ;-( Et je n'ai pas eu accès à l'ordinateur, juste un téléphone :-((((((((
  2. Tuto HC2

    I have confirmation from Fibaro that "httpClient:request(url..." blocks handle until the scene is over not to end of called http work and /api/service/backups/'..id can only be launched once at the same time. Therefore, to delete more than one file, you must call the external scene who delete backups In this case I updated code of backup-delete.lua and added backup-batch. All necessary parameters are passed automatically to backup-batch.lua, You only need edit parameters in backup-create.lua and backup-delete.lua. I added for batch process NotificationService with popups on web page like in situation with to many scenes run at same time backup-batch.lua backup-delete.lua backup-create.lua
  3. Tuto HC2

    I have "small" problem, when in run backup_delate.lua. If I have more that 1 backup to delete in one run, script delete only one backup (oldest - it's ok) from selected by criteria for deletion (red debug info) for other chosen backup HC2 return error 404. For delete next one and next (if exist) I need rerun the scene. But if I create for function deleteBackup(id) separate scene and I call it with parameter (id) from backup_delete.lua of course with sleep(45) between the next ID all work fine. ..//.. if... then fibaro:startScene(999, {{id_del = backups['id']}}) fibaro:sleep(45) end ..//.. For me is look like situation when backup_delate.lua block called http://127.0.0.1/api/service/backups/'..id until the scene end. Any from You have the same problem? Any idea?
  4. Tuto HC2

    Sorry for post in english and text in scenes, but it's faster to write for me. I need my modification because of many (biggest or smallest) problem each time when I upgrade HC2 with new firmware. And the problem not happen direct after upgrade, but hours or days after (like my last problem with corrupt z-wave databases or 503 error after restart) . For restore backup when I have 503 error without chance to login I use REST client for POST http://HC2IP/api/service/backups/ with payload {"action":"restore","params":{"id":928}}. "id" I take form GET http://HC2IP/api/service/backups Small modification of backup and delete: 1. Autodelete only autobackup (created by backup_store.lua scene) 2. Autodelete no oldest backup but delete backups by days from today. Note: Scenes not use any variables stored in HC2, they parse data by backup destricption In backup_store.lua you have this new parameters: backup_symbol = '!' -- this symbol is added on beginning of description on backup time. Scenes use this for identify autobackup and for not delete manual or upgrade time backups without this symbol (in example on attached printscreen I use ‘p’ on place of '!') backup_stay = '025' -- days for store backup from 001 to 999 days (obligatory with loading zeros). When for ex. you change this parameters for 1 backup from 030 to 025 and after this return to 030, only this one have different store time from another backups. In backup_delete.lua backup_symbol = '!' -- most important to be same to backup_symbol defined in backup_store.lua default_stay = 'no' -- use individual backup store time from description. Set 'yes' if you decide to ignore individual time to store backup defined in backup__store.lua and registered in backup description backup_stay = '030' -- if you decide to set default_stay to 'yes' backup_delete.lua use this for check number of day after witch the backup will be delete. The backup_delete.lua use this parameter too for backup with description who start by '!' but without [NNN] for number of store day (ex. for temporary backup created manually, they be delete after this number of day) Structure of backup description used by scenes: ![025] any character/any text ! - first symbol identify backup created and used by scenes, obligatory for treatment by this two scenes [025] - number of days for store backup, not obligatory, if not exist the backup_stay defined in backup_delete.lua are used. backup_delate.lua --[[ %% properties %% events %% globals --]] -- Flag dryrun; Si true, la requete sur api pour effacer le backup n'est pas effectuée local dryrun = true --[[ modification to delete only backup file created by autobackup scene (selected by '!' in descrption on first positon) and oldes more that 90 days Backups created manualy (without '!') are not deleted by this scene --]] local backup_stay = 10 -- time in day for store autobackup file if not use time in description ore no time in description local default_stay = 'no' -- if 'yes' use [backup_stay] for all autobackup file, if 'no' use number of days stored in desciption of backup local backup_symbol = '!' -- only delete after day stored in [backup_time] backup with this symbol on first postion in decription text. Need the same as in auto backup scene -- Password admin encodé en base64 local password = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' print('Current parameters:') print('only backups with description start by ['..backup_symbol..'] are processed') print('and deleted after: '..backup_stay..' day(s) if not dedicated information in description') if default_stay == 'yes' then print('Number of days for store backup is overwriten by '.. tostring(backup_stay) ..' day(s)') end function sortBackup(data) local backups = json.decode(data) -- Vérification de présence Backup if (backups and type(backups == 'table') and #backups > 0) then if #backups > 1 then print(#backups .. ' Backups présents') else print('1 Backup présent') end for i in ipairs(backups) do --fibaro:debug('<font color="red">ID: '..backups[i]['id']..' | TIME: '..os.date("%Y/%m/%d %H:%M:%S", backups[i]['timestamp'])..' | DESCRIPTION: '..backups[i]['description']) --print(os.date("%Y/%m/%d %H:%M:%S", backups[i]['timestamp'])) --print(os.time()) --print(os.time() - tonumber(backups[i]['timestamp'])) delta=os.time() - tonumber(backups[i]['timestamp']) todelete=string.sub(backups[i]['description'],1,1) -- =='!' if default_stay == 'no' and string.sub(backups[i]['description'],2,2) == '[' then -- obsłużyć gdy nie trafi na [] backup_stay_tmp=tonumber(string.sub(backups[i]['description'],3,5)) else backup_stay_tmp=backup_stay end -- print(tostring(backup_stay_tmp)..string.sub(backups[i]['description'],2,2)) -- print(string.sub(backups[i]['description'],1,1)) -- =='!' if delta <= backup_stay_tmp*60*60*24 and (string.sub(backups[i]['description'],1,1)) == backup_symbol then fibaro:debug('<font color="orange">ID: '..backups[i]['id']..' | TIME: '..os.date("%Y/%m/%d %H:%M:%S", backups[i]['timestamp'])..' | DESC: '..backups[i]['description']) fibaro:debug("^^^ To delete in ".. backup_stay_tmp-tostring(math.floor(delta/60/60/24)).." day from today ^^^") elseif delta > backup_stay_tmp*60*60*24 and (string.sub(backups[i]['description'],1,1)) == backup_symbol then fibaro:debug('<font color="red">ID: '..backups[i]['id']..' | TIME: '..os.date("%Y/%m/%d %H:%M:%S", backups[i]['timestamp'])..' | DESC: '..backups[i]['description']) print("^^^ Deleted this time ^^^") deleteBackup(backups[i]['id']) else fibaro:debug('<font color="green">ID: '..backups[i]['id']..' | TIME: '..os.date("%Y/%m/%d %H:%M:%S", backups[i]['timestamp'])..' | DESC: '..backups[i]['description']) end end else print('Pas de backup ou erreur lors de la récupération de la liste') fibaro:abort() end -- Pour chaque Backup on stock le timestamp de la date de réalisation dans une table -- On classe ensuite les timestamps par ordre croissant local timestamp = {} for i in ipairs(backups) do table.insert(timestamp, backups[i]['timestamp']) end table.sort(timestamp) -- Le 1er timestamp de la table est le plus petit donc le plus ancien en epochtime -- Dans la table de backup on recherche le backup ayant ce timestamp --[[ local id = false for i in ipairs(backups) do if (tonumber(backups[i]['timestamp']) == tonumber(timestamp[1])) then id = backups[i]['id'] end end if id then print("ID du backup le plus ancien: "..id) deleteBackup(id) else print("Erreur lors de la récupération de l'ID") fibaro:abort() end --]] end function deleteBackup(id) -- Requete via API pour effacer le backup le plus ancien if (not dryrun) and (id) then print('Effacement du backup '..id..' en cours. Cela peut prendre 30s') local url = 'http://127.0.0.1/api/service/backups/'..id local httpClient = net.HTTPClient() httpClient:request(url , { success = function(response) if tonumber(response.status) == 200 then print("Backup deleted at " .. os.date()) else print("Error " .. response.status) end end, error = function(err) print('error = ' .. err) end, options = { method = 'DELETE', headers = { ["content-type"] = 'application/x-www-form-urlencoded;', ["authorization"] = 'Basic '..password }, data = 'id='..id } }) end end -- Récupération de la list des backups local GETClient = net.HTTPClient() if dryrun then print('Mode DryRun -> La requète pour effacer ne sera pas éxécutée') end GETClient:request('http://127.0.0.1/api/service/backups', { success = function(response) if tonumber(response.status) == 200 then sortBackup(response.data) else print("Error " .. response.status) end end, error = function(err) print('error = ' .. err) end, headers = { ["content-type"] = 'application/x-www-form-urlencoded;', ["authorization"] = 'Basic '..password } }); backup_store.lua --[[ %% properties %% events %% globals --]] -- ID des mobiles,tablettes pour notification local portable = { 892 } local backup_symbol = '!' -- for auto delete only backups with this symbol on irst postion in description local backup_stay = '025' -- numbers of days to store autobackups (from 001 to 999 with loading zeros) print('Current parameters:') print('delete after: '..backup_stay..' day(s), only backups with description start by ['..backup_symbol..']') fibaro:sleep(10*1000) function sendPush(message) if #portable > 0 then for _,v in ipairs(portable) do fibaro:call(v,'sendPush', message) end end end -- Message Descriptif du Backup local descriptif = backup_symbol..'['..backup_stay..'] Autobackup - '..os.date("%d/%m/%y - %HH%M") -- Password admin encodé en base64 local password = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' local url = 'http://127.0.0.1/api/service/backups' local datas = '{"action":"create","params":{"name":"'..descriptif..'"}}' local httpClient = net.HTTPClient() httpClient:request(url , { success = function(response) if tonumber(response.status) == 201 or tonumber(response.status) == 202 then print("Backup Created at " .. os.date()) sendPush(descriptif .. ' effectué') else print("Error " .. response.status) sendPush('Erreur lors de la création du Backup - '.. response.status) end end, error = function(err) print('error = ' .. err) end, options = { method = 'POST', headers = { ["content-type"] = 'application/json', ["Authorization"] = 'Basic '..password }, data = datas } }); on image backup2 parameter dryrun = true on image backup3 parameter dryrun = false
  5. @ericl78 no... en version 9.9999 code secret de HC2 version = version + 0.001 if version < 9.999 then call funcion(minimum_1_error_creation) end if version >= 9.999 then call funcion(randomly_1_error_remove) end ...
  6. #!/bin/ash ############## # add this script to crontab of your router or any linux machine # i use openwrt router with sendmail, curl packages # */15 * * * * /scripts/hc2watchdog ############## set -e # IP of HC2 HCIP="192.168.1.n" # login string for HC2 HCLOG="admin@domain.pl:password" # email from mserver="mail.mail.pl" muser="hc2@domain.pl" mpass="password" # email to memail="user@domain.pl" status_www=`curl -N -I --user $HCLOG $HCIP/api/settings/info 2>/dev/null | head -n 1` echo $status_www status_server=`curl -N --user $HCLOG $HCIP/api/refreshStates 2>/dev/null | head -n 1 | cut -d',' -f1 | cut -d "{" -f2` status_time=`curl -N --user $HCLOG $HCIP/api/refreshStates 2>/dev/null | head -n 1 | cut -d',' -f3` echo "HC2 response:" echo "===============================" echo $status_server echo $status_time case "$status_server" in *status*) echo "HC2 working" echo $status_time exit ;; esac echo "Problem..." # send syslog message to my syslog server, put hash begin of next line if you not use logger "HC2 - restart $status_server" -p authpriv.alert -t HC2 echo "HC2 restart..." curl --user $HCLOG http://$HCIP/services/finishUpgradeAfterError.php # send email to you after restart, put hash begin of next line if you not use mailsend -smtp $mserver -port 587 -auth -user $muser -pass $mpass -starttls -f dom@durbajlo.email -name "HC2 watchdog" -t $memai echo "HC2 status " $status_server > /tmp/hc2.status echo "HC2 - oczekiwanie na restart" sleep 60s echo "HC2 - check after restart" echo "================================" status_www=`curl -N -I --user $HCLOG $HCIP/api/settings/info 2>/dev/null | head -n 1` echo $status_www status_server=`curl -N --user $HCLOG $HCIP/api/refreshStates 2>/dev/null | head -n 1 | cut -d',' -f1 | cut -d "{" -f2` status_time=`curl -N --user $HCLOG $HCIP/api/refreshStates 2>/dev/null | head -n 1 | cut -d',' -f3` echo $status_server echo $status_time Parce que, dans la version 4133 sont les mêmes erreurs que dans la version précédente, j'ai écrit un script pour redémarrer automatiquement de l'extérieur ma HC2 en cas d'erreur 503 ou d'un serveur interne de HC2. Tout en anglais à https://forum.fibaro.com/index.php?/topic/26127-external-watchdog-for-hc2/
  7. Je inclus cette fois normal, parce que je voulais tester rapidement. Apres premier démarre le moteur lui-même calibrer. Mais il est possible en changeant le paramètre 12 à 2 et à nouveau à 1 sur HC2 ou par boutons sur le motour. Dessous l'instruction, mais pas encore approuvé par Fakro, mais la description est correcte ZWS12n.pdf
  8. No sans templete J'ai parlé avec un ingénieur de Fakro (responsable du produit) Il ma dit que tout remis à Fibaro e ils attendent . Ils ont le problème similaire que nous clients avec des retards chez Fibaro avec implementation de template. Aujourd'hui, il est prévu pour la prochaine version stable. mais je ne crois pas... c'est Fibaro :-) Mais pour les 5 paramètres, je pense que n'a pas besoin tempate. Et voila, moteur est monté et opérationnel...
  9. Je l'ai testé une nouvelle version (v1.1) du moteur pour les fenêtres Fakro. Précédent version (v1) avec HC2 a permis que la fermeture ou l'ouverture a 100%. Nouvelle permet toute position - ferme, ouver 1-100% et fermeture par la pluie. Vous pouvez commander la version avec capteur de pluie (voir photo) ou sans. Version avec capteur de pluie aujourd'hui uniquement par email chez Fakro. Ce module peut contrôler directement les autres 5 moteurs sans détecteur (par groupe association nr 4). J'ai installé sans problem les 3 moteurs aux fenêtres et Velux et Fakro. Ils travaillent déjà trois semaines. Remarque. Sur Internet sont disponibles les anciennes versions de ZWS12 ou ZWS230 (v1), nouveaux moteurs sont marqués ZWS12n ou ZWS230n. Et si quelqu'un est intéressé devrait commander à Fakro. Le prix est 200 euros Voici les paramètres de configuration: No. Value Default Value Description 7 1234 1 Motor speed I 8 1234 2 Motor speed II (rain sensor) 12 12 1 Value 1 – calibrated Value 2 – discalibrated – to enter the calibration mode must first time discalibrate and then calibrate. 13 12 1 1 – FF go to Max 2 – FF go to previous position 15 0-255 0 Close after time (mn) Notyfication type: Event Water Alarm: Water Leak detected, Unknow Location Power Management: Over-load detected Association Groups: 1. Life Line – group for position reporting actuator after each a stoppage and alarm reporting (overcurrent, damage encoders). This group can be a maximum 1 device. 2. Basic Repeat – group used to transfer the received basic commands to the devices included in this group. This group can be a maximum 5 devices. 3. Multilevel Repeat – group used to transfer the received multilevel commands to the devices included in this group. This group can be a maximum 5 devices. 4. Basic Rain – group used to transfer the received commands from actuator & rain detector to the devices included in this group. This group can be a maximum 5 devices.
  10. Je pense que je avais des la même situation il y a un mois. J'ai perdu beaucoup de temps pour trouver une erreur.Comme je l'ai regardé le journal le problème était dans la table arp. Je ne sais pas pourquoi SONOS parfois mal et stocke l'adresse IP avec l'ARP. Il enregistrer l'adresse MAC de l'appareil normalement et aussi avec le début de 9a: de: d0. ex. 192.168.1.232 b8:e9:37:dd:ab:56 et deziem deuxième 9a: de: d0:dd:ab:56 Je ne l'ai pas eu le temps d'analyser, parce que le réseau entier est bloqué, et a la fin je suis retourné au réseau indépendant SONOS de mon WiFi.
  11. Check if in Your code exist many ", because You need use it only on begin & end of string on LUA level. In string (html) You need use &quot for " &lt for < etc... I have this problem when I past code first time to forum. The forum convert html &... to normal character when You not change typ of source. I doing concretion on 28.03, please check this in Your VD or paste this que: que = function() return sendSoapMessage( -- control url "/MediaRenderer/AVTransport/Control", -- service type "urn:schemas-upnp-org:service:AVTransport:1", -- action { name = "AddURIToQueue", service = "urn:schemas-upnp-org:service:AVTransport:1" }, -- soap body data (options) "<InstanceID>0</InstanceID>,<EnqueuedURI>file:///jffs/settings/savedqueues.rsq#"..list_nbr.."</EnqueuedURI>,<EnqueuedURIMetaData>&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:r=&quot;urn:schemas-rinconnetworks-com:metadata-1-0/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt;&lt;item id=&quot;SQ:1&quot; parentID=&quot;SQ:&quot; restricted=&quot;true&quot;&gt;&lt;dc:title&gt;"..list_name.."&lt;/dc:title&gt;&lt;upnp:class&gt;object.container.playlistContainer&lt;/upnp:class&gt;&lt;desc id=&quot;cdudn&quot; nameSpace=&quot;urn:schemas-rinconnetworks-com:metadata-1-0/&quot;&gt;RINCON_AssociatedZPUDN&lt;/desc&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;</EnqueuedURIMetaData>,<DesiredFirstTrackNumberEnqueued>1</DesiredFirstTrackNumberEnqueued>,<EnqueueAsNext>1</EnqueueAsNext>", -- callback (options) function(response) fibaro:debug("que"); end); end
  12. You need to the test, for ex. I have list of 9 playlist (see image bellow). The Sonos sort in application list by alphabet, but for the list give number by sequence of addition. In my example last added list is playlist SAUNA and they have number 9 I haven't the time for write the request for retrieve the list with number and name for for display in debug window. But is more simple when you use spotify with sonos. spotify_user - your spotify login used in sonos spotify_playlist - the id of playlist in spotify retrived like album id from spotify www - see first post. que = function() --playlist from Spotify return sendSoapMessage( -- control url "/MediaRenderer/AVTransport/Control", -- service type "urn:schemas-upnp-org:service:AVTransport:1", -- action { name = "AddURIToQueue", service = "urn:schemas-upnp-org:service:AVTransport:1" }, -- soap body data (options) "<InstanceID>0</InstanceID>,<EnqueuedURI>x-rincon-cpcontainer:10062a6cspotify%3auser%3a"..spotify_user.."%3aplaylist%3a"..spotify_playlist.."</EnqueuedURI>,<EnqueuedURIMetaData>&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:r=&quot;urn:schemas-rinconnetworks-com:metadata-1-0/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt;&lt;item id=&quot;10062a6cspotify%3auser%3a"..spotify_user.."%3aplaylist%3a"..spotify_playlist.."&quot; parentID=&quot;10082664playlists&quot; restricted=&quot;true&quot;&gt;&lt;dc:title&gt;Fibaro from Spotify&lt;/dc:title&gt;&lt;upnp:class&gt;object.container.playlistContainer&lt;/upnp:class&gt;&lt;desc id=&quot;cdudn&quot; nameSpace=&quot;urn:schemas-rinconnetworks-com:metadata-1-0/&quot;&gt;SA_RINCON2311_X_#Svc2311-0-Token&lt;/desc&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;</EnqueuedURIMetaData>,<DesiredFirstTrackNumberEnqueued>2</DesiredFirstTrackNumberEnqueued>,<EnqueueAsNext>1</EnqueueAsNext>", -- callback (options) function(response) fibaro:debug("que"); end); end ----
  13. Merci @Lazer Je ne l'ai pas trouvé le sujet, ma faute je ne l'ai pas regardé dans le BISTRO :-( Donc, nous attendons et voyons
  14. C'est intéressant https://www.qnap.com/en/news/2017/qnap-starts-cooperation-with-fibaro-providing-a-feature-packed-hub-for-smart-home-systems Questions: 1. Avec quel Z-wave USB fonctionnera? 2. Quelle série QNAP? 3. Quel est le prix du logiciel Fibaro?
  15. Tuto HC2

    Chez moi, après l'utilisation de le patch @Titof_44 et l'exécution de la commande httpClient:request("http://127.0.0.1:11111/api/sceneControl?id="..id.."&action=start") la commande fibaro:debug(fibaro:countScenes(id)) retourne 0, mais la scène fonctionne correctement. Bien sûr, Watchdog avec "0" redémarre la scène tout le temps Si la scène arrêté et redemarre par slide bouton fibaro:countScenes(id) returne bien 1 Pourquoi???