Aller au contenu
mprinfo

Utilisation De Fibaro:call En Fonction Du Module Commandé

Recommended Posts

Utilisation de fibaro:call en fonction du module commandé

 

 

Voici un lien qui vous donnera les actions que l'on peut utiliser pour chaque type de modules fibaro

 

http://www.fibarouk.co.uk/support/lua/actions-use-fibarocall-api/

 

 

close
 

Application pour : blind

 

Description:

Closes a blind.

 

Usage:

This action takes no arguments.

 

Exemple:

-- Close the blind with the device ID of 94
fibaro:call(94, "close")
 
open
 

Application pour : blind

 

Description:

Opens a blind.

 

Usage:

This action takes no arguments.

 

Exemple:

-- Open the blind with the device ID of 94
fibaro:call(94, "open")
 
pressButton
 

Application pour : virtual_device

 

Description:

Triggers a virtual device button press.

 

Usage:

This action takes one argument.

  • The number of the button to be pressed.  Each element of a virtual device has a unique number starting from 1.  If your virtual device has two labels followed by two buttons, the buttons will be numbered 3 and 4.

 

Exemple:

-- Trigger a button press of button 3 of 
-- the virtual device with an ID of 358
fibaro:call(358, "pressButton", "3")
 
sendDefinedEmailNotification
 

Application pour : HC_user

 

Description:

Sends a notification to the email address associated with a user.

 

Usage:

This action takes one argument.

  • The id of the notification to be sent.

 

Exemple:

1-- Send notification 2 via email to the
-- address associated with user 107.
fibaro:call(107, "sendDefinedEmailNotification", "2")
 
sendDefinedPushNotification
 

Application pour : iOS_device

 

Description:

Sends a push notification to a device.

 

Usage:

This action takes one argument.

  • The id of the notification to be sent.

 

Exemple:

-- Send notification 2 via push to modile device number 10.
fibaro:call(10, "sendDefinedPushNotification", "2")
 
sendDefinedSMSNotification
 

Application pour : HC_user

 

Description:

Sends an SMS notification to a phone number.

 

Usage:

This action takes two arguments.

  • The phone number to send the message to.

This should be in the form xxyyyyyyyyy where xx = country code and yyyyyyyyy = phone number.

  • The id of the notification to be sent.

 

Exemple:

-- Send notification 3 via SMS to device number +441234567890.
fibaro:call(2, "sendDefinedSMSNotification", "441234567890", "3")
 
sendEmail
 

Application pour : HC_user

 

Description:

Sends an email to the email address associated with a user.

 

Usage:

This action takes two arguments.

  • The subject of the email.
  • The message body of the email.

 

Exemple:

-- Send an email to the email address associated with user 2.
local subject = "This is the subject of the email."
local message = "This is the body of the email.\nWith a line break."
fibaro:call(2, "sendEmail", subject, message)
 
sendPhotoToEmail
 

Application pour : IP_camera

 

Description:

Sends a still image from a camera to a specified email address.

 

Usage:

This action takes one argument.

  • The email address to send the image to.

 

Exemple:

-- Send an image from camera 120 to someone@this.address.
fibaro:call(120, "sendPhotoToEmail", "someone@this.address")
 
sendPhotoToUser
 

Application pour : IP_camera

 

Description:

Sends a still image from a camera to the email address associated with a user.

 

Usage:

This action takes one argument.

  • The id number of the user to send the image to.

 

Exemple:

-- Send an image from camera 120 to 
-- the email address associated with user 2.
fibaro:call(120, "sendPhotoToUser", "2")
 
sendPush
 

Application pour : iOS_device

 

Description:

Sends a push notification to an iOS device.

The device must have connected with the Home Centre recently, however once this connection has been made the app can be closed.

 

Usage:

This action takes one argument.

  • The message to be pushed to the device.

 

Exemple:

 
-- Send a push notification to the iOS device with the ID of 10
fibaro:call(10, 'sendPush', 'This is the message to be pushed.')
 
 
setArmed
 

Application pour : motion_sensor, door_sensor, window_sensor, smoke_sensor

 

Description:

Arms or disarms a device.

 

Usage:

This action takes one argument.

  • The armed state of the device. 0 = disarmed, 1 = armed.

 

Exemple:

-- Arm the door sensor with device ID of 174
fibaro:call(174, "setArmed", "1")
 
-- Disarm the door sensor with device ID of 174
fibaro:call(174, "setArmed", "0")
 
setB
 

Application pour : rgb_driver

 

Description:

Sets the brightness of the blue channel of an rgb_driver.

 

Usage:

This action takes one argument.

  • The brightness (0-99) of the channel.

 

Exemple:

-- Set the brightness of the blue channel of device 81 to 56%
fibaro:call(81, "setB", "56")
 
 
setColor
 

Application pour : rgb_driver

 

Description:

Sets the colour of an rgb_driver.

This is done by setting the brightness of the red, green, blue and white channels.

 

Usage:

This action takes four arguments.

  • The brightness (0-99) of the red channel.

  • The brightness (0-99) of the green channel.

  • The brightness (0-99) of the blue channel.

  • The brightness (0-99) of the white channel.

Even if the device is in RGB mode, the white channel needs to be specified – in this case, just use 0.

 

Exemple:

-- Set the colour of device 81 to a blue-indigo colour
-- (60% red, 23% green, 99% blue, 0% white)
fibaro:call(81, "setColor", "60", "23", "99", "0")
 
setG
 

Application pour : rgb_driver

 

Description:

Sets the brightness of the green channel of an rgb_driver.

 

Usage:

This action takes one argument.

  • The brightness (0-99) of the channel.

 

Exemple:

-- Set the brightness of the green channel of device 81 to 56%
fibaro:call(81, "setG", "56")
 
setProperty
 

Application pour : virtual_device

 

Description:

Sets value of the elements of a virtual device (labels and sliders).

 

Usage:

This action takes two arguments.

  • The name of the element.

  • The value to set the element to.

 

Exemple:

-- Set the content of Label1 in virtual device 1170 to 'program 1'
fibaro:call(1170, "setProperty", "ui.Label1.value", "program 1")
 
-- Set the value of Slider1 in virtual device 1170 to 45
fibaro:call(1170, "setProperty", "ui.Slider1.value", "45")
 
setR
 

Application pour : rgb_driver

 

Description:

Sets the brightness of the red channel of an rgb_driver.

 

Usage:

This action takes one argument.

  • The brightness (0-99) of the channel.

 

Exemple:

-- Set the brightness of the red channel of device 81 to 56%
fibaro:call(81, "setR", "56")
setSlider
 

Application pour : virtual_device

 

Description:

Triggers a change in the value of a virtual device slider.

 

Usage:

This action takes two arguments.

  • The number of the slider to be changed.  Each element of a virtual device has a unique number starting from 1.  If your virtual device has two labels followed by two buttons and then a slider, the slider will be numbered 5.

  • The value (0-99) to set the slider to.

 

Exemple:

-- Set the slider with an ID of 2 of the 
-- virtual device with an ID of 334 to 50%
fibaro:call(334, "setSlider", "2", "50")
 
 
setTargetLevel
 

Application pour : thermostat_setpoint

 

Description:

Sets the target temperature of a thermostat_setpoint.

 

Usage:

This action takes one argument.

  • A temperature in degrees.

 

Exemple:

-- Set the target temperature of device 117 to 18 degrees.
fibaro:call(117, "setTargetLevel", "18")
 
 
setTime
 

Application pour : thermostat_setpoint

 

Description:

Sets the value of the timeStamp property of the thermostat_setpoint.

 

Usage:

This action takes one argument.

  • A timestamp.

 

Exemple:

-- Set the timeStamp of the thermostat_setpoint 
-- with device ID of 117 to 2 hours from now.
fibaro:call(117, "setTime", tonumber(os.time()) + 120*60)
 
 
setValue
 

Application pour : dimmable_light, blind, rgb_driver

 

Description:

Sets the brightness of a dimmable_light or rgb_driver or sets the position of a blind.

When changing the brightness of rgb_drivers, all channels are set to the same level (white light).

 

Usage:

This action takes one argument.

  • A value (0-99) representing the brightness of the light or position of the blind.

    For a blind, 0 = fully closed, 99 = fully open.

 

Exemple:

-- Set the brightness of the light with device ID of 68 to 25%.
fibaro:call(68, "setvalue", "25")
 
-- Set the position of the blind with the device ID of 94 to 75% open.
fibaro:call(94, "setvalue", "75")
 
setW
 

Application pour : rgb_driver

 

Description:

Sets the brightness of the white channel of an rgb_driver.

 

Usage:

This action takes one argument.

  • The brightness (0-99) of the channel.

 

Exemple:

-- Set the brightness of the white channel of device 81 to 56%
fibaro:call(81, "setW", "56")

 

startProgram
 

Application pour : rgb_driver

 

Description:

Instruct the rgb_driver to play one of the preconfigured colour programmes.

 

Usage:

This action takes one argument.

  • The light programme number to run.

 

Exemple:

-- Start programme number 2 ("storm") on device number 81
fibaro:call(81, "startProgram", "2")
 
stop
 
 

Application pour : blind

 

Description:

Stops the movement of a blind.

 

Usage:

This action takes no arguments.

 

Exemple:

-- Stop the blind with the device ID of 94
fibaro:call(94, "stop")
turnOff
 

Application pour : binary_light, dimmable_light, rgb_driver

 

Description:

Turns off a device.

 

Usage:

This action takes no arguments.

 

Exemple:

-- Turn off device number 58.
fibaro:call(58, "turnOff")
 
turnOn
 

Application pour : binary_light, dimmable_light, rgb_driver

 

Description:

Turns on a device.

 

Usage:

This action takes no arguments.

 

Exemple:

-- Turn on device number 58.
fibaro:call(58, "turnOn")
 
  • Upvote 6

Partager ce message


Lien à poster
Partager sur d’autres sites

Merci @mprinfo

 

Très bonne idée.

Partager ce message


Lien à poster
Partager sur d’autres sites

On voit qu'il fait froid dans l'Est. On est mieux au chaud derrière l'ordi.

Bravo. Joli boulot.

  • Upvote 1

Partager ce message


Lien à poster
Partager sur d’autres sites

On peut compléter avec ceci:

Les commandes en noir ne réponde pas àfibaro:call mais àl'API "callAction" dont on trouve un bon descriptif ici: http://tutoriels.domotique-store.fr/content/49/45/fr/api-commander-le-home-center-par-des-requ%C3%AAtes-http.html

Partager ce message


Lien à poster
Partager sur d’autres sites

beau boulôt, merci MPR !!!

  • Upvote 1

Partager ce message


Lien à poster
Partager sur d’autres sites

super tuto j'épingle en favoris cela fera un pense bête

merci MPR

Partager ce message


Lien à poster
Partager sur d’autres sites

Super. Cool merci

Envoyé de mon SM-G928F en utilisant Tapatalk

Partager ce message


Lien à poster
Partager sur d’autres sites

je suis content de passer en revue tous les posts non encore lus. Heureusement que j'ai vu celui-ci !

Merci

Partager ce message


Lien à poster
Partager sur d’autres sites

oh Yeahhhhhh je me faisais chier avec les sendpushdefinednitifcations.... mais là avec le send push je suis chaud.... c'est 100 fois mieux ! bcp plus facile à gérer ! oh je suis content.... je vais revoir mon pleind e truc ! 

LUA en force quand meme :)

 

merci pour l'article !

Partager ce message


Lien à poster
Partager sur d’autres sites
--[[ Lumière du séjour --]]
local startSource = fibaro:getSourceTrigger();
if 
 ( tonumber(fibaro:getValue(171, "value")) > 0 )
  or
 ( tonumber(fibaro:getValue(166, "value")) > 0 )
then
	fibaro:call(531, "sendPush", "Une des lumières du séjour est allumée");
    --fibaro:call(293, "sendDefinedPushNotification", "31");

ça change tout !  en plus j'ai fais un OR :) pooooop poooop pooooop @Nico je fais pas que du bloc maintenant LOOOL :p

  • Like 1

Partager ce message


Lien à poster
Partager sur d’autres sites

×