Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Search the Community

Showing results for tags 'sendine email'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • FIBARO Community
    • FIBARO Portal and Forum policy
    • FIBARO
    • Say hello!
    • Off-topics
  • FIBARO Update
    • FIBARO System Update
    • FIBARO Mobile Update
  • FIBARO Community Support
    • Scenes and Interface
    • FIBARO Products
    • FIBARO Mobile
    • FIBARO HomeKit
    • FIBARO Assistant Integrations
    • Other Devices / Third-party devices
    • Tutorials and Guides
    • Home Automation
    • Suggestions
  • FIBARO Społeczność
    • FIBARO
    • Przywitaj się!
    • Off-topic
  • FIBARO Aktualizacja
    • FIBARO System Aktualizacja
    • FIBARO Mobile Aktualizacja
  • FIBARO Wsparcie Społeczności
    • Sceny i Interfejs
    • FIBARO Urządzenia
    • FIBARO Mobilnie
    • FIBARO HomeKit
    • Integracja z Amazon Alexa i Google Home
    • Urządzenia Firm Trzecich
    • Poradniki
    • Automatyka Domowa
    • Sugestie

Categories

  • Scenes
  • Virtual Devices
  • Quick Apps
  • Icons

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Facebook


Google+


Skype


Website URL


WhatsApp


Country


Gateway/s


Interests

Found 1 result

  1. i use my HC2 to send an email when some door sensors are armed. therefore i use: -- Alarm an-- local message_on = (os.date("Haustüre um %H:%M Uhr zugesperrt. Die Fenster und die Haustüre sind scharf! (%d.%m.%Y)")) local subject_on = "Haustüre zugesperrt" fibaro:call(2, 'sendEmail', subject_on, message_on) my script is triggered with an contact in my door when i lock it. the contact works fine, so i can see in debug! but often the email is not be sent! maybe my script has an bug ? here the whole script: --[[ %% properties 128 value %% globals --]] ------------------------------ --###---- Variablen ----###-- ------------------------------ local windowID = {30,113,99} -- IDs der Sensoren die ge-/entschärft werden sollen local countID = 200 -- zähler für maximale Kontaktanzahl local riegel = 128 -- ID Riegelkontakt -- farbige Debug Meldungen Debug = function ( color, message ) fibaro:debug(string.format('<%s style="color:%s;">%s', "span", color, message, "span")) end -- Alarm an-- local message_on = (os.date("Haustüre um %H:%M Uhr zugesperrt. Die Fenster und die Haustüre sind scharf! (%d.%m.%Y)")) local subject_on = "Haustüre zugesperrt" -- Alarm aus-- local message_off = (os.date("Haustüre um %H:%M Uhr aufgesperrt. Der Alarm wurde deaktiviert. (%d.%m.%Y)")) local subject_off = "Haustüre aufgesperrt" ------------------------------ --###---- Funktionen ----###-- ------------------------------ -- An -- function Notify_on() --->> Hier muss der Code rein wenn der Alarm aktiviert wurde <<--- fibaro:call(2, 'sendEmail', subject_on, message_on) end -- Aus -- function Notify_off() --->> Hier muss der Code rein wenn der Alarm deaktiviert wurde <<--- fibaro:call(2, 'sendEmail', subject_off, message_off) end --- Arm-Check --- function armedcheckSensorID(array) for j=1, countID do if windowID[j] ~= nil then if (tonumber(fibaro:getValue(windowID[j], 'armed')) == 0) then return false end end end return true end ---Disarm Check --- function disarmedcheckSensorID(array) for j=1, countID do if windowID[j] ~= nil then if (tonumber(fibaro:getValue(windowID[j], 'armed')) == 1) then return false end end end return true end ------------------------------ --###---- Skript ----###-- ------------------------------ --- Schärfen --- if ( (tonumber(fibaro:getValue(riegel, "value")) == 0 ) ) then --fibaro:debug('Türe Abgeschlossen') Debug('green','Türe Abgeschlossen') for j=1, countID do if windowID[j] ~= nil then if (tonumber(fibaro:getValue(windowID[j], 'value')) == 0) then fibaro:call(windowID[j], 'setArmed', '1') else local sensorname = fibaro:getName(windowID[j]) local sensorroom = fibaro:getRoomNameByDeviceID(windowID[j]) local subject_unsafe = 'ACHTUNG: ' ..sensorroom.. ' offen!' local message_unsafe = 'Im Raum: ' .. sensorroom ..' ist der '.. sensorname ..' nicht geschlossen!' Debug('red',message_unsafe) fibaro:call(2, 'sendEmail', subject_unsafe, message_unsafe) fibaro:call(141, 'sendPush', message_unsafe) -- Galaxy S7 -- fibaro:call(159, 'sendPush', message_unsafe) -Nexus 4 end end end if (armedcheckSensorID(windowID)) then Debug('green','Alle Sensoren scharf.') Notify_on() end else end --- Entschäfen --- if ( (tonumber(fibaro:getValue(riegel, "value")) == 1 ) ) then Debug('green','Türe Aufgeschlossen.') fibaro:call(2, 'sendEmail', 'Wohnung wurde aufgesperrt') for j=1, countID do if windowID[j] ~= nil then if (tonumber(fibaro:getValue(windowID[j], 'value')) == 0) then fibaro:call(windowID[j], 'setArmed', '0') else local sensorname = fibaro:getName(windowID[j]) local sensorroom = fibaro:getRoomNameByDeviceID(windowID[j]) local subject_unsafe = 'ACHTUNG: ' ..sensorroom.. ' offen!' local message_unsafe = 'Im Raum: ' .. sensorroom ..' ist der '.. sensorname ..' nicht geschlossen!' Debug('red',message_unsafe) --fibaro:call(2, 'sendEmail', subject_unsafe, message_unsafe) --fibaro:call(2, 'sendPush', message_unsafe) end end end if (disarmedcheckSensorID(windowID)) then Debug('green','Alle Sensoren entschärft.') Notify_off(); end else end
×
×
  • Create New...