├── VERSION ├── data ├── debug.log ├── images │ └── put_device_images_here └── time.xml ├── info.php ├── css ├── lcars.eot ├── lcars.ttf ├── lcars.woff ├── jquery-mobile-green-button-theme.css ├── jquery-mobile-red-button-theme.css ├── standard.css └── fbswitch.css ├── favicon.ico ├── app-icon-on.png ├── get_actions.php ├── get_devices.php ├── get_groups.php ├── app-icon-off.png ├── images ├── Thumbs.db ├── splash.jpg ├── #res │ ├── logo.png │ ├── logo.zip │ ├── Thumbs.db │ ├── favicon.ico │ ├── favicon.png │ ├── lights2.png │ ├── favicon_OLD.png │ ├── logo_resize.png │ ├── splash_OLD.jpg │ ├── switch-icon.png │ ├── switch-icon_0.png │ ├── switch-icon_1.png │ ├── switch-icon_2.png │ ├── logo_alternativ.jpg │ ├── logo_alternativ.png │ ├── splash_body_OLD.jpg │ ├── logo_resize_475x475.png │ ├── apple-touch-icon-57x57_OLD.png │ ├── apple-touch-icon-72x72_OLD.png │ ├── apple-touch-icon-114x114_OLD.png │ └── apple-touch-icon-144x144_OLD.png ├── dark_wood.png ├── lk_musik.png ├── lk_raeume.png ├── lk_timer.png ├── lk_wetter.png ├── res │ ├── logo.png │ ├── logo.zip │ ├── favicon.ico │ ├── favicon.png │ ├── lights2.png │ ├── splash_OLD.jpg │ ├── favicon_OLD.png │ ├── logo_resize.png │ ├── switch-icon.png │ ├── switch-icon_0.png │ ├── switch-icon_1.png │ ├── switch-icon_2.png │ ├── logo_alternativ.jpg │ ├── logo_alternativ.png │ ├── splash_body_OLD.jpg │ ├── logo_resize_475x475.png │ ├── apple-touch-icon-114x114_OLD.png │ ├── apple-touch-icon-144x144_OLD.png │ ├── apple-touch-icon-57x57_OLD.png │ └── apple-touch-icon-72x72_OLD.png ├── ajax-loader.gif ├── app-icon-off.png ├── app-icon-on.png ├── lk_favoriten.png ├── lk_geraete.png ├── lk_gruppen.png ├── lk_statistik.png ├── splash_body.jpg ├── icons-18-black.png ├── icons-18-white.png ├── icons-36-black.png ├── icons-36-white.png ├── ajax-loader_old.gif ├── lk_einstellungen.png ├── apple-touch-icon-36x36-precomposed.png ├── apple-touch-icon-48x48-precomposed.png ├── apple-touch-icon-57x57-precomposed.png ├── apple-touch-icon-58x58-precomposed.png ├── apple-touch-icon-60x60-precomposed.png ├── apple-touch-icon-72x72-precomposed.png ├── apple-touch-icon-76x76-precomposed.png ├── apple-touch-icon-96x96-precomposed.png ├── apple-touch-startup-image-320x460.png ├── apple-touch-startup-image-640x1096.png ├── apple-touch-startup-image-640x920.png ├── apple-touch-startup-image-748x1024.png ├── apple-touch-startup-image-768x1004.png ├── apple-touch-icon-114x114-precomposed.png ├── apple-touch-icon-120x120-precomposed.png ├── apple-touch-icon-144x144-precomposed.png ├── apple-touch-icon-152x152-precomposed.png ├── apple-touch-icon-180x180-precomposed.png ├── apple-touch-icon-192x192-precomposed.png ├── apple-touch-startup-image-1496x2048.png └── apple-touch-startup-image-1536x2008.png ├── sounds ├── alert.wav ├── button.wav ├── button2.wav ├── button3.wav ├── button4.wav ├── button5.wav ├── button6.wav ├── button7.wav ├── error.wav ├── button_double.wav └── button_double2.wav ├── createcountdown.php ├── themes ├── images │ ├── Thumbs.db │ ├── beach.jpg │ ├── cars.jpg │ ├── rage.jpg │ ├── swamp.jpg │ ├── hilltop.jpg │ ├── library.jpg │ ├── sailor.jpg │ ├── shelter.jpg │ ├── asteroids.jpg │ ├── black_mesa.jpg │ ├── fairytale.jpg │ ├── milltown.jpg │ ├── scumm_bar.jpg │ ├── interstellar.jpg │ ├── black_mesa_skin.jpg │ ├── desktop_bg_02.png │ ├── desktop_bg_03.png │ ├── desktop_bg_04.png │ ├── desktop_bg_05.png │ ├── desktop_bg_07.png │ ├── desktop_bg_08.png │ ├── pirates_grave.jpg │ ├── stalker_kitten.jpg │ └── stalker_kitten_green.jpg ├── desktop_bg_02.css ├── desktop_bg_03.css ├── desktop_bg_04.css ├── desktop_bg_05.css ├── desktop_bg_07.css ├── desktop_bg_08.css ├── desktop_bg_black.css ├── desktop_bg_swamp.css ├── desktop_bg_hilltop.css ├── desktop_bg_sailor.css ├── desktop_bg_cars.css ├── desktop_bg_fairytale.css ├── desktop_bg_rage.css ├── desktop_bg_beach.css ├── desktop_bg_interstellar.css ├── desktop_bg_asteroids.css ├── desktop_bg_library.css ├── desktop_bg_milltown.css ├── desktop_bg_scumm_bar.css ├── desktop_bg_shelter.css ├── desktop_bg_black_mesa.css ├── desktop_bg_pirates_grave.css ├── desktop_bg_stalker_kitten.css ├── desktop_bg_black_mesa_skin.css ├── desktop_bg_stalker_kitten_green.css ├── desktop_bg_06.css └── desktop_bg_09.css ├── get_sysstate.php ├── js └── jquery.toast.mobile.js ├── debug.php ├── milight_ajax.php ├── manifest.json ├── cache.manifest ├── findmilight.php ├── alert.html ├── findgateway.php ├── redalert_OBS.php ├── includes ├── incl_debug.php ├── incl_edit_groups.php ├── incl_functions.php ├── incl_groups.php ├── incl_settings_design.php └── incl_actions.php ├── edit_group.php ├── get_fbdect_energy.php ├── get_fbdect_temp.php ├── README.md ├── countdowntimer.php ├── edit_person.php ├── gui_debug.php ├── configeditor.php ├── edit_device.php ├── edit_config.php ├── gui.php ├── index.php ├── edit_timer.php ├── fritzbox.inc.php ├── redalert_thread.php └── redalert.php /VERSION: -------------------------------------------------------------------------------- 1 | 1.0.9.1-STABLE -------------------------------------------------------------------------------- /data/debug.log: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /info.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/images/put_device_images_here: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /css/lcars.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/css/lcars.eot -------------------------------------------------------------------------------- /css/lcars.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/css/lcars.ttf -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/favicon.ico -------------------------------------------------------------------------------- /app-icon-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/app-icon-on.png -------------------------------------------------------------------------------- /css/lcars.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/css/lcars.woff -------------------------------------------------------------------------------- /get_actions.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/get_actions.php -------------------------------------------------------------------------------- /get_devices.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/get_devices.php -------------------------------------------------------------------------------- /get_groups.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/get_groups.php -------------------------------------------------------------------------------- /app-icon-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/app-icon-off.png -------------------------------------------------------------------------------- /data/time.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /images/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/Thumbs.db -------------------------------------------------------------------------------- /images/splash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/splash.jpg -------------------------------------------------------------------------------- /sounds/alert.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/sounds/alert.wav -------------------------------------------------------------------------------- /sounds/button.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/sounds/button.wav -------------------------------------------------------------------------------- /sounds/button2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/sounds/button2.wav -------------------------------------------------------------------------------- /sounds/button3.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/sounds/button3.wav -------------------------------------------------------------------------------- /sounds/button4.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/sounds/button4.wav -------------------------------------------------------------------------------- /sounds/button5.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/sounds/button5.wav -------------------------------------------------------------------------------- /sounds/button6.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/sounds/button6.wav -------------------------------------------------------------------------------- /sounds/button7.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/sounds/button7.wav -------------------------------------------------------------------------------- /sounds/error.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/sounds/error.wav -------------------------------------------------------------------------------- /createcountdown.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/createcountdown.php -------------------------------------------------------------------------------- /images/#res/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/logo.png -------------------------------------------------------------------------------- /images/#res/logo.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/logo.zip -------------------------------------------------------------------------------- /images/dark_wood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/dark_wood.png -------------------------------------------------------------------------------- /images/lk_musik.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/lk_musik.png -------------------------------------------------------------------------------- /images/lk_raeume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/lk_raeume.png -------------------------------------------------------------------------------- /images/lk_timer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/lk_timer.png -------------------------------------------------------------------------------- /images/lk_wetter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/lk_wetter.png -------------------------------------------------------------------------------- /images/res/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/logo.png -------------------------------------------------------------------------------- /images/res/logo.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/logo.zip -------------------------------------------------------------------------------- /images/#res/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/Thumbs.db -------------------------------------------------------------------------------- /images/#res/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/favicon.ico -------------------------------------------------------------------------------- /images/#res/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/favicon.png -------------------------------------------------------------------------------- /images/#res/lights2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/lights2.png -------------------------------------------------------------------------------- /images/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/ajax-loader.gif -------------------------------------------------------------------------------- /images/app-icon-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/app-icon-off.png -------------------------------------------------------------------------------- /images/app-icon-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/app-icon-on.png -------------------------------------------------------------------------------- /images/lk_favoriten.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/lk_favoriten.png -------------------------------------------------------------------------------- /images/lk_geraete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/lk_geraete.png -------------------------------------------------------------------------------- /images/lk_gruppen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/lk_gruppen.png -------------------------------------------------------------------------------- /images/lk_statistik.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/lk_statistik.png -------------------------------------------------------------------------------- /images/res/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/favicon.ico -------------------------------------------------------------------------------- /images/res/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/favicon.png -------------------------------------------------------------------------------- /images/res/lights2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/lights2.png -------------------------------------------------------------------------------- /images/splash_body.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/splash_body.jpg -------------------------------------------------------------------------------- /themes/images/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/Thumbs.db -------------------------------------------------------------------------------- /themes/images/beach.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/beach.jpg -------------------------------------------------------------------------------- /themes/images/cars.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/cars.jpg -------------------------------------------------------------------------------- /themes/images/rage.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/rage.jpg -------------------------------------------------------------------------------- /themes/images/swamp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/swamp.jpg -------------------------------------------------------------------------------- /images/icons-18-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/icons-18-black.png -------------------------------------------------------------------------------- /images/icons-18-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/icons-18-white.png -------------------------------------------------------------------------------- /images/icons-36-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/icons-36-black.png -------------------------------------------------------------------------------- /images/icons-36-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/icons-36-white.png -------------------------------------------------------------------------------- /images/res/splash_OLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/splash_OLD.jpg -------------------------------------------------------------------------------- /sounds/button_double.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/sounds/button_double.wav -------------------------------------------------------------------------------- /sounds/button_double2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/sounds/button_double2.wav -------------------------------------------------------------------------------- /themes/images/hilltop.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/hilltop.jpg -------------------------------------------------------------------------------- /themes/images/library.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/library.jpg -------------------------------------------------------------------------------- /themes/images/sailor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/sailor.jpg -------------------------------------------------------------------------------- /themes/images/shelter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/shelter.jpg -------------------------------------------------------------------------------- /images/#res/favicon_OLD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/favicon_OLD.png -------------------------------------------------------------------------------- /images/#res/logo_resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/logo_resize.png -------------------------------------------------------------------------------- /images/#res/splash_OLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/splash_OLD.jpg -------------------------------------------------------------------------------- /images/#res/switch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/switch-icon.png -------------------------------------------------------------------------------- /images/ajax-loader_old.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/ajax-loader_old.gif -------------------------------------------------------------------------------- /images/lk_einstellungen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/lk_einstellungen.png -------------------------------------------------------------------------------- /images/res/favicon_OLD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/favicon_OLD.png -------------------------------------------------------------------------------- /images/res/logo_resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/logo_resize.png -------------------------------------------------------------------------------- /images/res/switch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/switch-icon.png -------------------------------------------------------------------------------- /images/res/switch-icon_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/switch-icon_0.png -------------------------------------------------------------------------------- /images/res/switch-icon_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/switch-icon_1.png -------------------------------------------------------------------------------- /images/res/switch-icon_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/switch-icon_2.png -------------------------------------------------------------------------------- /themes/images/asteroids.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/asteroids.jpg -------------------------------------------------------------------------------- /themes/images/black_mesa.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/black_mesa.jpg -------------------------------------------------------------------------------- /themes/images/fairytale.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/fairytale.jpg -------------------------------------------------------------------------------- /themes/images/milltown.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/milltown.jpg -------------------------------------------------------------------------------- /themes/images/scumm_bar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/scumm_bar.jpg -------------------------------------------------------------------------------- /images/#res/switch-icon_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/switch-icon_0.png -------------------------------------------------------------------------------- /images/#res/switch-icon_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/switch-icon_1.png -------------------------------------------------------------------------------- /images/#res/switch-icon_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/switch-icon_2.png -------------------------------------------------------------------------------- /images/res/logo_alternativ.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/logo_alternativ.jpg -------------------------------------------------------------------------------- /images/res/logo_alternativ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/logo_alternativ.png -------------------------------------------------------------------------------- /images/res/splash_body_OLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/splash_body_OLD.jpg -------------------------------------------------------------------------------- /themes/images/interstellar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/interstellar.jpg -------------------------------------------------------------------------------- /images/#res/logo_alternativ.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/logo_alternativ.jpg -------------------------------------------------------------------------------- /images/#res/logo_alternativ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/logo_alternativ.png -------------------------------------------------------------------------------- /images/#res/splash_body_OLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/splash_body_OLD.jpg -------------------------------------------------------------------------------- /themes/images/black_mesa_skin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/black_mesa_skin.jpg -------------------------------------------------------------------------------- /themes/images/desktop_bg_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/desktop_bg_02.png -------------------------------------------------------------------------------- /themes/images/desktop_bg_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/desktop_bg_03.png -------------------------------------------------------------------------------- /themes/images/desktop_bg_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/desktop_bg_04.png -------------------------------------------------------------------------------- /themes/images/desktop_bg_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/desktop_bg_05.png -------------------------------------------------------------------------------- /themes/images/desktop_bg_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/desktop_bg_07.png -------------------------------------------------------------------------------- /themes/images/desktop_bg_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/desktop_bg_08.png -------------------------------------------------------------------------------- /themes/images/pirates_grave.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/pirates_grave.jpg -------------------------------------------------------------------------------- /themes/images/stalker_kitten.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/stalker_kitten.jpg -------------------------------------------------------------------------------- /images/#res/logo_resize_475x475.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/logo_resize_475x475.png -------------------------------------------------------------------------------- /images/res/logo_resize_475x475.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/logo_resize_475x475.png -------------------------------------------------------------------------------- /themes/images/stalker_kitten_green.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/themes/images/stalker_kitten_green.jpg -------------------------------------------------------------------------------- /get_sysstate.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/#res/apple-touch-icon-57x57_OLD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/apple-touch-icon-57x57_OLD.png -------------------------------------------------------------------------------- /images/#res/apple-touch-icon-72x72_OLD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/apple-touch-icon-72x72_OLD.png -------------------------------------------------------------------------------- /images/res/apple-touch-icon-114x114_OLD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/apple-touch-icon-114x114_OLD.png -------------------------------------------------------------------------------- /images/res/apple-touch-icon-144x144_OLD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/apple-touch-icon-144x144_OLD.png -------------------------------------------------------------------------------- /images/res/apple-touch-icon-57x57_OLD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/apple-touch-icon-57x57_OLD.png -------------------------------------------------------------------------------- /images/res/apple-touch-icon-72x72_OLD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/res/apple-touch-icon-72x72_OLD.png -------------------------------------------------------------------------------- /images/#res/apple-touch-icon-114x114_OLD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/apple-touch-icon-114x114_OLD.png -------------------------------------------------------------------------------- /images/#res/apple-touch-icon-144x144_OLD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/#res/apple-touch-icon-144x144_OLD.png -------------------------------------------------------------------------------- /images/apple-touch-icon-36x36-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-icon-36x36-precomposed.png -------------------------------------------------------------------------------- /images/apple-touch-icon-48x48-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-icon-48x48-precomposed.png -------------------------------------------------------------------------------- /images/apple-touch-icon-57x57-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-icon-57x57-precomposed.png -------------------------------------------------------------------------------- /images/apple-touch-icon-58x58-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-icon-58x58-precomposed.png -------------------------------------------------------------------------------- /images/apple-touch-icon-60x60-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-icon-60x60-precomposed.png -------------------------------------------------------------------------------- /images/apple-touch-icon-72x72-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-icon-72x72-precomposed.png -------------------------------------------------------------------------------- /images/apple-touch-icon-76x76-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-icon-76x76-precomposed.png -------------------------------------------------------------------------------- /images/apple-touch-icon-96x96-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-icon-96x96-precomposed.png -------------------------------------------------------------------------------- /images/apple-touch-startup-image-320x460.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-startup-image-320x460.png -------------------------------------------------------------------------------- /images/apple-touch-startup-image-640x1096.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-startup-image-640x1096.png -------------------------------------------------------------------------------- /images/apple-touch-startup-image-640x920.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-startup-image-640x920.png -------------------------------------------------------------------------------- /images/apple-touch-startup-image-748x1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-startup-image-748x1024.png -------------------------------------------------------------------------------- /images/apple-touch-startup-image-768x1004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-startup-image-768x1004.png -------------------------------------------------------------------------------- /images/apple-touch-icon-114x114-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-icon-114x114-precomposed.png -------------------------------------------------------------------------------- /images/apple-touch-icon-120x120-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-icon-120x120-precomposed.png -------------------------------------------------------------------------------- /images/apple-touch-icon-144x144-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-icon-144x144-precomposed.png -------------------------------------------------------------------------------- /images/apple-touch-icon-152x152-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-icon-152x152-precomposed.png -------------------------------------------------------------------------------- /images/apple-touch-icon-180x180-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-icon-180x180-precomposed.png -------------------------------------------------------------------------------- /images/apple-touch-icon-192x192-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-icon-192x192-precomposed.png -------------------------------------------------------------------------------- /images/apple-touch-startup-image-1496x2048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-startup-image-1496x2048.png -------------------------------------------------------------------------------- /images/apple-touch-startup-image-1536x2008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/FB.Switch/master/images/apple-touch-startup-image-1536x2008.png -------------------------------------------------------------------------------- /themes/desktop_bg_02.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { background-image: url(images/desktop_bg_02.png); background-repeat: repeat;;width: 100%;left:0;} 4 | } -------------------------------------------------------------------------------- /themes/desktop_bg_03.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { background-image: url(images/desktop_bg_03.png); background-repeat: repeat;width: 100%;left:0;} 4 | } -------------------------------------------------------------------------------- /themes/desktop_bg_04.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { background-image: url(images/desktop_bg_04.png); background-repeat: repeat;width: 100%;left:0;} 4 | } -------------------------------------------------------------------------------- /themes/desktop_bg_05.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { background-image: url(images/desktop_bg_05.png); background-repeat: repeat;width: 100%;left:0;} 4 | } -------------------------------------------------------------------------------- /themes/desktop_bg_07.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { background-image: url(images/desktop_bg_07.png); background-repeat: repeat;width: 100%;left:0;} 4 | } -------------------------------------------------------------------------------- /themes/desktop_bg_08.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { background-image: url(images/desktop_bg_08.png); background-repeat: repeat;width: 100%;left:0;} 4 | } -------------------------------------------------------------------------------- /themes/desktop_bg_black.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background: center no-repeat #000000; 5 | width: 100%; 6 | height: 100%; 7 | position: fixed; 8 | left: 0px; 9 | top: 0px; 10 | background-size: cover; 11 | z-index:0; 12 | } 13 | } -------------------------------------------------------------------------------- /themes/desktop_bg_swamp.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background-image: url(images/swamp.jpg); 5 | width: 100%; 6 | height: 100%; 7 | position: fixed; 8 | left: 0px; 9 | top: 0px; 10 | background-repeat: no-repeat; 11 | background-size: cover; 12 | z-index:0; 13 | } 14 | } -------------------------------------------------------------------------------- /themes/desktop_bg_hilltop.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background-image: url(images/hilltop.jpg); 5 | width: 100%; 6 | height: 100%; 7 | position: fixed; 8 | left: 0px; 9 | top: 0px; 10 | background-repeat: no-repeat; 11 | background-size: cover; 12 | z-index:0; 13 | } 14 | } -------------------------------------------------------------------------------- /themes/desktop_bg_sailor.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background-image: url(images/sailor.jpg); 5 | width: 100%; 6 | height: 100%; 7 | position: fixed; 8 | left: 0px; 9 | top: 0px; 10 | background-repeat: no-repeat; 11 | background-size: cover; 12 | z-index:0; 13 | } 14 | } -------------------------------------------------------------------------------- /themes/desktop_bg_cars.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background-image: url(images/cars.jpg); 5 | width: 100%; 6 | height: 100%; 7 | position: fixed; 8 | left: 0px; 9 | top: 0px; 10 | background-repeat: no-repeat; 11 | background-size: cover; 12 | z-index:0; 13 | } 14 | } -------------------------------------------------------------------------------- /themes/desktop_bg_fairytale.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background-image: url(images/fairytale.jpg); 5 | width: 100%; 6 | height: 100%; 7 | position: fixed; 8 | left: 0px; 9 | top: 0px; 10 | background-repeat: no-repeat; 11 | background-size: cover; 12 | z-index:0; 13 | } 14 | } -------------------------------------------------------------------------------- /themes/desktop_bg_rage.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background-image: url(images/rage.jpg); 5 | width: 100%; 6 | height: 100%; 7 | position: fixed; 8 | left: 0px; 9 | top: 0px; 10 | background-repeat: no-repeat; 11 | background-size: cover; 12 | z-index:0; 13 | } 14 | } -------------------------------------------------------------------------------- /themes/desktop_bg_beach.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background-image: url(images/beach.jpg); 5 | width: 100%; 6 | height: 100%; 7 | position: fixed; 8 | left: 0px; 9 | top: 0px; 10 | background-repeat: no-repeat; 11 | background-size: cover; 12 | z-index:0; 13 | } 14 | } -------------------------------------------------------------------------------- /themes/desktop_bg_interstellar.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background-image: url(images/interstellar.jpg); 5 | width: 100%; 6 | height: 100%; 7 | position: fixed; 8 | left: 0px; 9 | top: 0px; 10 | background-repeat: no-repeat; 11 | background-size: cover; 12 | z-index:0; 13 | } 14 | } -------------------------------------------------------------------------------- /themes/desktop_bg_asteroids.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background-image: url(images/asteroids.jpg); 5 | width: 100%; 6 | height: 100%; 7 | position: fixed; 8 | left: 0px; 9 | top: 0px; 10 | background-repeat: no-repeat; 11 | background-size: cover; 12 | z-index:0; 13 | } 14 | } -------------------------------------------------------------------------------- /themes/desktop_bg_library.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background-image: url(images/library.jpg); 5 | width: 100%; 6 | height: 100%; 7 | position: fixed; 8 | left: 0px; 9 | top: 0px; 10 | background-repeat: no-repeat; 11 | background-size: cover; 12 | z-index:0; 13 | } 14 | } -------------------------------------------------------------------------------- /themes/desktop_bg_milltown.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background-image: url(images/milltown.jpg); 5 | width: 100%; 6 | height: 100%; 7 | position: fixed; 8 | left: 0px; 9 | top: 0px; 10 | background-repeat: no-repeat; 11 | background-size: cover; 12 | z-index:0; 13 | } 14 | } -------------------------------------------------------------------------------- /themes/desktop_bg_scumm_bar.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background-image: url(images/scumm_bar.jpg); 5 | width: 100%; 6 | height: 100%; 7 | position: fixed; 8 | left: 0px; 9 | top: 0px; 10 | background-repeat: no-repeat; 11 | background-size: cover; 12 | z-index:0; 13 | } 14 | } -------------------------------------------------------------------------------- /themes/desktop_bg_shelter.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background-image: url(images/shelter.jpg); 5 | width: 100%; 6 | height: 100%; 7 | position: fixed; 8 | left: 0px; 9 | top: 0px; 10 | background-repeat: no-repeat; 11 | background-size: cover; 12 | z-index:0; 13 | } 14 | } -------------------------------------------------------------------------------- /themes/desktop_bg_black_mesa.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background-image: url(images/black_mesa.jpg); 5 | width: 100%; 6 | height: 100%; 7 | position: fixed; 8 | left: 0px; 9 | top: 0px; 10 | background-repeat: no-repeat; 11 | background-size: cover; 12 | z-index:0; 13 | } 14 | } -------------------------------------------------------------------------------- /themes/desktop_bg_pirates_grave.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background-image: url(images/pirates_grave.jpg); 5 | width: 100%; 6 | height: 100%; 7 | position: fixed; 8 | left: 0px; 9 | top: 0px; 10 | background-repeat: no-repeat; 11 | background-size: cover; 12 | z-index:0; 13 | } 14 | } -------------------------------------------------------------------------------- /themes/desktop_bg_stalker_kitten.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background-image: url(images/stalker_kitten.jpg); 5 | width: 100%; 6 | height: 100%; 7 | position: fixed; 8 | left: 0px; 9 | top: 0px; 10 | background-repeat: no-repeat; 11 | background-size: cover; 12 | z-index:0; 13 | } 14 | } -------------------------------------------------------------------------------- /themes/desktop_bg_black_mesa_skin.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background-image: url(images/black_mesa_skin.jpg); 5 | width: 100%; 6 | height: 100%; 7 | position: fixed; 8 | left: 0px; 9 | top: 0px; 10 | background-repeat: no-repeat; 11 | background-size: cover; 12 | z-index:0; 13 | } 14 | } -------------------------------------------------------------------------------- /themes/desktop_bg_stalker_kitten_green.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background-image: url(images/stalker_kitten_green.jpg); 5 | width: 100%; 6 | height: 100%; 7 | position: fixed; 8 | left: 0px; 9 | top: 0px; 10 | background-repeat: no-repeat; 11 | background-size: cover; 12 | z-index:0; 13 | } 14 | } -------------------------------------------------------------------------------- /themes/desktop_bg_06.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background-color: #026873; 5 | background-image: linear-gradient(90deg, rgba(8,15,24,.07) 50%, transparent 50%), 6 | linear-gradient(90deg, rgba(28,15,24,.13) 50%, transparent 50%), 7 | linear-gradient(90deg, transparent 50%, rgba(8,15,24,.17) 50%), 8 | linear-gradient(90deg, transparent 50%, rgba(8,15,24,.19) 50%); 9 | background-size: 13px, 29px, 37px, 53px; 10 | background-repeat: repeat; 11 | width: 100%; 12 | left:0; 13 | 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /js/jquery.toast.mobile.js: -------------------------------------------------------------------------------- 1 | var toast=function(msg) { 2 | $("

"+msg+"

") 3 | .css({ display: "block", 4 | opacity: 0.90, 5 | position: "fixed", 6 | padding: "7px", 7 | "text-align": "center", 8 | width: "270px", 9 | left: ($(window).width() - 284)/2, 10 | top: $(window).height()/2 - 60 }) 11 | .appendTo( $.mobile.pageContainer ).delay( 1500 ) 12 | .fadeOut( 500, function() { 13 | $(this).remove(); 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /themes/desktop_bg_09.css: -------------------------------------------------------------------------------- 1 | @media (min-width:1100px) { 2 | 3 | #bg { 4 | background: 5 | linear-gradient(27deg, #151515 5px, transparent 5px) 0 5px, 6 | linear-gradient(207deg, #151515 5px, transparent 5px) 10px 0px, 7 | linear-gradient(27deg, #222 5px, transparent 5px) 0px 10px, 8 | linear-gradient(207deg, #222 5px, transparent 5px) 10px 5px, 9 | linear-gradient(90deg, #1b1b1b 10px, transparent 10px), 10 | linear-gradient(#1d1d1d 25%, #1a1a1a 25%, #1a1a1a 50%, transparent 50%, transparent 75%, #242424 75%, #242424); 11 | background-color: #131313; 12 | background-size: 20px 20px; 13 | width: 100%; 14 | left:0; 15 | } 16 | } -------------------------------------------------------------------------------- /debug.php: -------------------------------------------------------------------------------- 1 | 31 | -------------------------------------------------------------------------------- /milight_ajax.php: -------------------------------------------------------------------------------- 1 | setDelay(0); 8 | $milight->setRepeats(1); 9 | $milight->setRgbwActiveGroup((integer)$_GET['mlgroup']); 10 | 11 | if (isset($_GET['off'])) { 12 | $milight->rgbwSendOffToGroup($_GET['off']); 13 | $result = "#OK#"; 14 | } 15 | if (isset($_GET['on'])) { 16 | $milight->setActiveGroupSend(1); 17 | $milight->rgbwSendOnToGroup($_GET['on']); 18 | $milight->setActiveGroupSend(0); 19 | $result = "#OK#"; 20 | } 21 | if (isset($_GET['white'])) { 22 | $milight->rgbwSetGroupToWhite($_GET['white']); 23 | $result = "#OK#"; 24 | } 25 | if (isset($_GET['night'])) { 26 | $milight->rgbwSetGroupToNightMode($_GET['night']); 27 | $result = "#OK#"; 28 | } 29 | if (isset($_GET['hue'])) { 30 | //$result = $_GET['mlip'].":".$_GET['mlport']." ".$_GET['mlgroup'].":".$_GET['hue']; 31 | $milight->rgbwSetColorHsv([$_GET['hue'], 1, 0.5]); 32 | $result = "#OK#"; 33 | } 34 | if (isset($_GET['brightness'])) { 35 | //echo $_GET['hue']; 36 | $milight->rgbwBrightnessPercent(min(100,$_GET['brightness'])); 37 | $result = "#OK#"; 38 | } 39 | 40 | unset($milight); 41 | echo $result; 42 | ?> -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "FB.Switch", 3 | "short_name": "FB.Switch", 4 | "scope": "/fb-switch/", 5 | "start_url": "/fb-switch/index.php", 6 | "display": "fullscreen", 7 | 8 | "icons": [ 9 | { 10 | "src": "images/apple-touch-icon-36x36-precomposed.png", 11 | "sizes": "36x36", 12 | "type": "image/png", 13 | "density": "0.75" 14 | }, 15 | { 16 | "src": "images/apple-touch-icon-48x48-precomposed.png", 17 | "sizes": "48x48", 18 | "type": "image/png", 19 | "density": "1.0" 20 | }, 21 | { 22 | "src": "images/apple-touch-icon-72x72-precomposed.png", 23 | "sizes": "72x72", 24 | "type": "image/png", 25 | "density": "1.5" 26 | }, 27 | { 28 | "src": "images/apple-touch-icon-96x96-precomposed.png", 29 | "sizes": "96x96", 30 | "type": "image/png", 31 | "density": "2.0" 32 | }, 33 | { 34 | "src": "images/apple-touch-icon-144x144-precomposed.png", 35 | "sizes": "144x144", 36 | "type": "image/png", 37 | "density": "3.0" 38 | }, 39 | { 40 | "src": "images/apple-touch-icon-192x192-precomposed.png", 41 | "sizes": "192x192", 42 | "type": "image/png", 43 | "density": "4.0" 44 | } 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /cache.manifest: -------------------------------------------------------------------------------- 1 | CACHE MANIFEST 2 | # Version: 1.3 3 | 4 | CACHE: 5 | manifest.json 6 | app-icon-off.png 7 | app-icon-on.png 8 | favicon.ico 9 | css/fbswitch.css 10 | css/jquery.mobile-1.3.0.min.css 11 | css/jquery-mobile-green-button-theme.css 12 | css/jquery-mobile-red-button-theme.css 13 | css/spectrum.css 14 | css/standard.css 15 | css/standard_design.css 16 | images/ajax-loader.gif 17 | images/splash.jpg 18 | images/splash_body.jpg 19 | images/app-icon-off.png 20 | images/app-icon-on.png 21 | images/apple-touch-icon-57x57.png 22 | images/apple-touch-icon-72x72.png 23 | images/apple-touch-icon-114x114.png 24 | images/apple-touch-icon-144x144.png 25 | images/apple-touch-startup-image-320x460.png 26 | images/apple-touch-startup-image-640x920.png 27 | images/apple-touch-startup-image-640x1096.png 28 | images/apple-touch-startup-image-748x1024.png 29 | images/apple-touch-startup-image-768x1004.png 30 | images/apple-touch-startup-image-1496x2048.png 31 | images/apple-touch-startup-image-1536x2008.png 32 | images/dark_wood.png 33 | images/icons-18-black.png 34 | images/icons-18-white.png 35 | images/icons-36-black.png 36 | images/icons-36-white.png 37 | images/lk_einstellungen.png 38 | images/lk_favoriten.png 39 | images/lk_geraete.png 40 | images/lk_gruppen.png 41 | images/lk_musik.png 42 | images/lk_raeume.png 43 | images/lk_statistik.png 44 | images/lk_timer.png 45 | images/lk_wetter.png 46 | js/jquery.mobile-1.3.0.min.js 47 | js/jquery.toast.mobile.js 48 | js/jquery-1.9.0.min.js 49 | js/spectrum.js 50 | 51 | NETWORK: 52 | *.php 53 | -------------------------------------------------------------------------------- /css/jquery-mobile-green-button-theme.css: -------------------------------------------------------------------------------- 1 | .ui-btn-up-g, .ui-btn-hover-g, .ui-btn-down-g 2 | { 3 | color: white; 4 | font-weight: bold; 5 | text-decoration: none; 6 | } 7 | 8 | .ui-btn-up-g 9 | { 10 | border: 1px solid #397114; 11 | background: #5aab25; 12 | text-shadow: 0 -1px 1px #397114; 13 | background-image: -moz-linear-gradient(top, #7ec44f, #5aab25); 14 | background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #87c45e), color-stop(1, #619e39)); 15 | -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#7ec44f', EndColorStr='#5aab25')"; 16 | } 17 | 18 | .ui-btn-hover-g 19 | { 20 | border: 1px solid #2c6e00; 21 | background: #75b54a; 22 | text-shadow: 0 -1px 1px #2a6901; 23 | background-image: -moz-linear-gradient(top, #99d472, #75b54a); 24 | background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #99d472), color-stop(1, #75b54a)); 25 | -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#99d472', EndColorStr='#75b54a')"; 26 | } 27 | 28 | .ui-btn-down-g 29 | { 30 | border: 1px solid #457823; 31 | background: #7ec44f; 32 | text-shadow: 0 -1px 1px #457823; 33 | background-image: -moz-linear-gradient(top, #619e39, #7ec44f); 34 | background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #619e39), color-stop(1, #7ec44f)); 35 | -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#619e39', EndColorStr='#7ec44f')"; 36 | } 37 | 38 | .ui-btn-up-g, .ui-btn-hover-g, .ui-btn-down-g 39 | { 40 | color: white; 41 | font-weight: bold; 42 | text-decoration: none; 43 | } 44 | 45 | -------------------------------------------------------------------------------- /findmilight.php: -------------------------------------------------------------------------------- 1 | 1,'usec'=>500000); 7 | 8 | if(!($socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP))) { 9 | $errorcode = socket_last_error(); 10 | $errormsg = socket_strerror($errorcode); 11 | 12 | die('{"ERROR":{"ERRORCODE":'.json_encode($errorcode).',"ERRORMSG":'.json_encode($errormsg).'}}'); 13 | } 14 | 15 | socket_set_option($socket, SOL_SOCKET, SO_BROADCAST, 1); 16 | socket_sendto($socket, $broadcast_string, strlen($broadcast_string), 0, '255.255.255.255', $port); 17 | 18 | socket_set_option($socket,SOL_SOCKET,SO_RCVTIMEO,$timeout); 19 | 20 | $from_recv = ''; 21 | $port_recv = 0; 22 | $mlbridge = array(); 23 | $id=10; 24 | 25 | while($len = @socket_recvfrom($socket, $buf, 255, 0, $from_recv, $port_recv)) { 26 | if($buf != "") { 27 | $dataString = explode(",", $buf); 28 | for ($cnt=0;$cnt < count($dataString);$cnt=$cnt+2) { 29 | if ($dataString[$cnt] != "") { 30 | $data = array(); 31 | $data['ID'] = $id; 32 | $data['STATUS'] = 'OK'; 33 | $data['IP'] = $dataString[$cnt]; 34 | $data['MAC'] = $output = wordwrap($dataString[$cnt+1],2,':',true); 35 | $data['PORT'] = "8899"; 36 | $mlbridge["MILIGHT".$id] = $data; 37 | } 38 | } 39 | $id++; 40 | } 41 | } 42 | 43 | if (empty($mlbridge)) { 44 | $mlbridge["MILIGHT".$id] = array('ID' => $id, 'STATUS' => 'NOT FOUND'); 45 | } 46 | echo json_encode($mlbridge); 47 | socket_close($socket); 48 | ?> 49 | -------------------------------------------------------------------------------- /alert.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | System Alert 6 | 7 | 8 | 9 | 10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | ALARM 37 | SYSTEM GESPERRT 38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /findgateway.php: -------------------------------------------------------------------------------- 1 | 1,'usec'=>500000); 7 | 8 | if(!($socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP))) { 9 | $errorcode = socket_last_error(); 10 | $errormsg = socket_strerror($errorcode); 11 | 12 | die('{"ERROR":{"ERRORCODE":'.json_encode($errorcode).',"ERRORMSG":'.json_encode($errormsg).'}}'); 13 | } 14 | 15 | socket_set_option($socket, SOL_SOCKET, SO_BROADCAST, 1); 16 | socket_sendto($socket, $broadcast_string, strlen($broadcast_string), 0, '255.255.255.255', $port); 17 | 18 | socket_set_option($socket,SOL_SOCKET,SO_RCVTIMEO,$timeout); 19 | 20 | $from_recv = ''; 21 | $port_recv = 0; 22 | $hcgw = array(); 23 | $id=1; 24 | 25 | while($len = @socket_recvfrom($socket, $buf, 255, 0, $from_recv, $port_recv)) { 26 | if("HCGW" == substr($buf, 0 , 4)) { 27 | $dataString = explode("HCGW:",$buf); 28 | for ($cnt=0;$cnt < count($dataString);$cnt++) { 29 | if ($dataString[$cnt] != "") { 30 | $data = array(); 31 | $data['ID'] = $id; 32 | $data['STATUS'] = 'OK'; 33 | foreach (explode(";", $dataString[$cnt]) as $keyValuePair) { 34 | if(!$keyValuePair) continue; 35 | list ($key, $value) = explode(':', $keyValuePair, 2); 36 | $data[$key] = $value; 37 | } 38 | $data['PORT'] = $port; 39 | $hcgw["HCGW".$id] = $data; 40 | } 41 | } 42 | $id++; 43 | } 44 | } 45 | 46 | if (empty($hcgw)) { 47 | $hcgw["HCGW".$id] = array('ID' => $id, 'STATUS' => 'NOT FOUND'); 48 | } 49 | echo json_encode($hcgw); 50 | socket_close($socket); 51 | ?> 52 | -------------------------------------------------------------------------------- /redalert_OBS.php: -------------------------------------------------------------------------------- 1 | message; 24 | } 25 | exit(4); 26 | } 27 | 28 | // Abbrechen wenn AlertState NICHT red ist 29 | if ($xml->global->AlertState != "red") exit(); 30 | 31 | 32 | function async_curl($background_process=''){ 33 | $ch = curl_init($background_process); 34 | curl_setopt_array($ch, array( 35 | CURLOPT_HEADER => 0, 36 | CURLOPT_RETURNTRANSFER =>true, 37 | CURLOPT_NOSIGNAL => 1, //to timeout immediately if the value is < 1000 ms 38 | CURLOPT_TIMEOUT_MS => 50, //The maximum number of mseconds to allow cURL functions to execute 39 | CURLOPT_VERBOSE => 1, 40 | CURLOPT_HEADER => 1 41 | )); 42 | $out = curl_exec($ch); 43 | curl_close($ch); 44 | return true; 45 | } 46 | 47 | foreach($xml->milightwifis->milightwifi as $milightwifi) { 48 | async_curl('http://localhost'.str_replace('redalert.php', 'redalert_thread.php?bid='.trim($milightwifi->id), $_SERVER[PHP_SELF])); 49 | //echo 'http://localhost'.str_replace('redalert.php', 'redalert_thread.php?bid='.trim($milightwifi->id), $_SERVER[PHP_SELF])."
"; 50 | } 51 | ?> -------------------------------------------------------------------------------- /includes/incl_debug.php: -------------------------------------------------------------------------------- 1 | 6 | 29 |
30 | 31 |
32 | Einstellungen 33 |

Debug

34 | Reload 35 |
36 | 37 |
38 | 50 |
51 |
52 | -------------------------------------------------------------------------------- /edit_group.php: -------------------------------------------------------------------------------- 1 | groups->group as $group) { 17 | $oldid=(integer)$group->id; 18 | if($oldid >= $newid) { 19 | $newid = $oldid + 1; 20 | } 21 | } 22 | 23 | $newgroup = $xml->groups->addChild('group'); 24 | 25 | 26 | $newgroup->addChild('id', $newid); 27 | $newgroup->addChild('name', $r_name); 28 | unset($_POST['action']); 29 | unset($_POST['id']); 30 | unset($_POST['Groupname']); # Entfernen 31 | 32 | $string = array_keys($_POST); # Array umdrehen 33 | 34 | for($i=0; $iaddChild('deviceid', $string[$i]); 36 | } 37 | 38 | echo'ok'; 39 | config_save(); 40 | break; 41 | 42 | case "edit": 43 | $xpath='//group/id[.="'.$r_id.'"]/parent::*'; 44 | $res = $xml->xpath($xpath); 45 | $parent = $res[0]; 46 | $parent[0]->name = $r_name; 47 | unset($_POST['action']); 48 | unset($_POST['id']); 49 | unset($_POST['Groupname']); # Entfernen 50 | $string = array_keys($_POST); # Array umdrehen 51 | unset($parent[0]->deviceid); 52 | foreach($string as $device){ 53 | $parent[0]->addChild('deviceid', $device); 54 | } 55 | echo "ok"; 56 | config_save(); 57 | break; 58 | 59 | case "delete": 60 | $xpath='//group/id[.="'.$r_id.'"]/parent::*'; 61 | $res = $xml->xpath($xpath); 62 | $parent = $res[0]; 63 | unset($parent[0]); 64 | echo "ok"; 65 | config_save(); 66 | break; 67 | 68 | default: 69 | echo "unsupported"; 70 | break; 71 | } 72 | ?> 73 | -------------------------------------------------------------------------------- /get_fbdect_energy.php: -------------------------------------------------------------------------------- 1 | message; 23 | } 24 | exit(4); 25 | } 26 | 27 | $ResStr=""; 28 | if ($xml->backend->sidsource != "" || ($xml->fritzbox->username != "" || $xml->fritzbox->password != "") && $xml->fritzbox->address != "") { 29 | $XMLdata = Fritzbox_GetHAactorsInfoXML(); 30 | if ($XMLdata != -1) { 31 | foreach($xml->devices->device as $device) { 32 | if ($device->vendor == "fbdect200") { 33 | if (Fritzbox_GetHAactorDataFromXML($XMLdata,trim($device->address->masterdip),'present') == 1) { 34 | $ResStr .= trim($device->id).":".Fritzbox_GetHAactorDataFromXML($XMLdata,trim($device->address->masterdip),'power').":".Fritzbox_GetHAactorDataFromXML($XMLdata,trim($device->address->masterdip),'energy')."|"; 35 | } else { 36 | $ResStr .= trim($device->id).":-1:-1|"; 37 | } 38 | } 39 | } 40 | } 41 | else { 42 | foreach($xml->devices->device as $device) { 43 | if ($device->vendor == "fbdect200") { 44 | $ResStr .= trim($device->id).":".Fritzbox_DECT200_Power($device->address->masterdip).":".Fritzbox_DECT200_Energie($device->address->masterdip)."|"; 45 | } 46 | } 47 | } 48 | } 49 | echo substr($ResStr, 0, strlen($ResStr)-1); 50 | ?> -------------------------------------------------------------------------------- /css/jquery-mobile-red-button-theme.css: -------------------------------------------------------------------------------- 1 | /* Red button theme for JQuery Mobile 2 | * - Use data-theme="r" for red versions of the default JQuery Mobile Buttons. 3 | ******************************************************************************************/ 4 | 5 | .ui-btn-up-r { 6 | border: 1px solid #721414; 7 | background: #AB2525; 8 | font-weight: bold; 9 | color: #fff; 10 | text-shadow: 0 -1px 1px #000; 11 | background-image: -moz-linear-gradient(top, #C54E4E, #AB2525); 12 | background-image: -webkit-gradient(linear,left top,left bottom, 13 | color-stop(0, #C54E4E), 14 | color-stop(1, #AB2525)); 15 | -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#C54E4E', EndColorStr='#AB2525')"; 16 | } 17 | .ui-btn-up-r a.ui-link-inherit { 18 | color: #fff; 19 | } 20 | .ui-btn-hover-r { 21 | border: 1px solid #6E0000; 22 | background: #B64B4B; 23 | font-weight: bold; 24 | color: #fff; 25 | text-shadow: 0 -1px 1px #000; 26 | background-image: -moz-linear-gradient(top, 27 | #D47272, 28 | #B64B4B); 29 | background-image: -webkit-gradient(linear,left top,left bottom, 30 | color-stop(0, #D47272), 31 | color-stop(1, #B64B4B)); 32 | -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#D47272', EndColorStr='#B64B4B')"; 33 | } 34 | .ui-btn-hover-r a.ui-link-inherit { 35 | color: #fff; 36 | } 37 | .ui-btn-down-r { 38 | border: 1px solid #772222; 39 | background: #C54E4E; 40 | font-weight: bold; 41 | color: #fff; 42 | text-shadow: 0 -1px 1px #000; 43 | background-image: -moz-linear-gradient(top, #9E3939, #C54E4E); 44 | background-image: -webkit-gradient(linear,left top,left bottom, 45 | color-stop(0, #9E3939), 46 | color-stop(1, #C54E4E)); 47 | -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#9E3939', EndColorStr='#C54E4E')"; 48 | } 49 | .ui-btn-down-r a.ui-link-inherit { 50 | color: #fff; 51 | } 52 | .ui-btn-up-r, 53 | .ui-btn-hover-r, 54 | .ui-btn-down-r { 55 | font-family: Helvetica, Arial, sans-serif; 56 | text-decoration: none; 57 | } 58 | -------------------------------------------------------------------------------- /get_fbdect_temp.php: -------------------------------------------------------------------------------- 1 | message; 23 | } 24 | exit(4); 25 | } 26 | 27 | $FBnet_SIDsource = $xml->backend->sidsource; 28 | $NewOutdoorTemp = false; 29 | 30 | // Alternative Outoor-Temp-Quelle (Backend) fuer bestimmten Actor nehmen? 31 | $UseAltOutdoorTempSource = $xml->global->UseAlternateOutdoorTempSource; 32 | 33 | if($UseAltOutdoorTempSource != "" && $UseAltOutdoorTempSource != "false") { 34 | $AltDat = file_get_contents($UseAltOutdoorTempSource); 35 | if ($AltDat !== false) { 36 | $OutdoorTempSource = $xml->global->OutdoorTempSource; 37 | $NewOutdoorTemp = explode("|",$AltDat); 38 | $NewOutdoorDate = $NewOutdoorTemp[2]; 39 | $NewOutdoorDateDiff = time() - strtotime($NewOutdoorDate); 40 | if ($NewOutdoorDateDiff > 1800) { 41 | $NewOutdoorTemp = -1000; 42 | } else $NewOutdoorTemp = $NewOutdoorTemp[0]; 43 | if ($NewOutdoorTemp === false || $NewOutdoorTemp == "") $NewOutdoorTemp = -1000; 44 | } 45 | } 46 | 47 | $ResStr=""; 48 | if ($FBnet_SIDsource != "" || ($xml->fritzbox->username != "" || $xml->fritzbox->password != "") && $xml->fritzbox->address != "") { 49 | $XMLdata = Fritzbox_GetHAactorsInfoXML(); 50 | foreach($xml->devices->device as $device) { 51 | if ($device->vendor == "fbdect200") { 52 | if($NewOutdoorTemp !== false && trim($device->id) == $OutdoorTempSource) { 53 | $ResStr .= trim($device->id).":".trim($NewOutdoorTemp)."|"; 54 | } else { 55 | if (Fritzbox_GetHAactorDataFromXML($XMLdata,trim($device->address->masterdip),'present') == 1) { 56 | $ResStr .= trim($device->id).":".Fritzbox_GetHAactorDataFromXML($XMLdata,trim($device->address->masterdip),'temperature')."|"; 57 | } else { 58 | $ResStr .= trim($device->id).":-1000|"; 59 | } 60 | } 61 | } 62 | } 63 | } 64 | echo substr($ResStr, 0, strlen($ResStr)-1); 65 | ?> -------------------------------------------------------------------------------- /css/standard.css: -------------------------------------------------------------------------------- 1 | .ui-field-contain div.ui-slider-switch, .ui-field-contain.ui-hide-label div.ui-slider-switch {width:150px;overflow:hidden} 2 | .ui-slider-switch .ui-slider-label-b {margin-right: 10px;} 3 | .timer_activ_on {color: #6AB638;} 4 | .timer_activ_off { color: #B63737;} 5 | /* icon größe von der liste */ 6 | .ui-li-thumb, .ui-li-icon { 7 | left: 1px; 8 | max-height: 32px; 9 | max-width: 32px; 10 | position: absolute; 11 | top: 0; 12 | } 13 | 14 | .ui-icon-on { 15 | background-image: url("../images/app-icon-on.png"); 16 | } 17 | .ui-icon-off { 18 | background-image: url("../images/app-icon-off.png"); 19 | } 20 | 21 | .ui-dialog-contain { 22 | width: 92.5%; 23 | max-width: 1100px; 24 | margin: 0% auto 15px auto; 25 | padding: 0; 26 | position: relative; 27 | top: -20px; 28 | } 29 | 30 | .navigation{ 31 | display:none; 32 | } 33 | /* 34 | .ui-grid-a .ui-block-a { width: 66.95%; } 35 | .ui-grid-a .ui-block-b { width: 32.925%; } 36 | .ui-grid-a .ui-block-a { clear: left; } 37 | */ 38 | 39 | .hide { 40 | visibility:hidden; 41 | display:none; 42 | } 43 | .show { 44 | visibility:visible; 45 | 46 | display:inline; 47 | } 48 | 49 | @media (min-width:28em) and (max-width:35em) { 50 | .ui-field-contain div.ui-slider-switch, .ui-field-contain.ui-hide-label div.ui-slider-switch {width:150px}} 51 | 52 | @media (min-width:35em) { 53 | 54 | /* wrap on wide viewports once open */ 55 | 56 | .ui-field-contain div.ui-slider-switch, .ui-field-contain.ui-hide-label div.ui-slider-switch {width:150px} 57 | 58 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-push.ui-panel-content-fixed-toolbar-position-left, 59 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-reveal.ui-panel-content-fixed-toolbar-position-left, 60 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-wrap-display-push.ui-panel-content-wrap-position-left, 61 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-wrap-display-reveal.ui-panel-content-wrap-position-left { 62 | margin-right: 17em; 63 | } 64 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-push.ui-panel-content-fixed-toolbar-position-right, 65 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-reveal.ui-panel-content-fixed-toolbar-position-right, 66 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-wrap-display-push.ui-panel-content-wrap-position-right, 67 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-wrap-display-reveal.ui-panel-content-wrap-position-right { 68 | margin-left: 17em; 69 | } 70 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-push, 71 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-reveal { 72 | width: auto; 73 | } 74 | 75 | /* disable "dismiss" on wide viewports */ 76 | .ui-responsive-panel .ui-panel-dismiss-display-push { 77 | display: none; 78 | } 79 | 80 | } 81 | 82 | .ui-loading .ui-loader 83 | { 84 | display: none !important; 85 | } 86 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FB.Switch [![GitHub release](https://img.shields.io/github/release/bombcheck/FB.Switch.svg)](https://github.com/bombcheck/FB.Switch/releases/latest) 2 | 3 | *Webapp zur Steuerung und Verwaltung von 433-MHz-Funksteckdosen, FritzDect 200-Steckdosen und MiLight-Lampen.* 4 | 5 | ![FB.Switch Screenshot](https://breakout.bernis-hideout.de/git/FB.Switch/fb-switch.jpg) 6 | 7 | ## Features: 8 | * Aufgebaut mit jQuery UI: Passt sich automatisch an verschiedene Browser und Mobilgeräte an 9 | * Kann unter iOS und Android ähnlich einer nativen App direkt vom Springboard/Launcher gestartet werden 10 | * Unterstützt das Schalten diverser Funksteckdosen (z.B. Brennenstuhl, Elro) über ein entsprechendes LAN-Gateway 11 | * Unterstützt das Schalten und die Verbrauchs- sowie Temperaturabfrage an einer vorhandenen FritzBox angeschlossener FritzDect 200-Steckdosen 12 | * Unterstützt das Schalten sowie die Farb- und Moduswahl von MiLight-RGBW-LED-Lampen über ein entsprechendes LAN-Gateway (bis einschließlich v5) 13 | * Unterstützt das Schalten sowie die Farb- und Moduswahl von MiLight-RGBCCT-LED-Lampen über den [FB.MiLight-Hub](https://github.com/bombcheck/esp8266_milight_hub) 14 | * Verwaltung von Geräten und Gerätegruppen 15 | * Definierung von Timern für Geräte und Gruppen. Für MiLight-Geräte kann im Timer definiert werden mit welchem Modus/Farbe/Helligkeit eingeschaltet werden soll 16 | * Definierung von Aktionen für Geräte und Gruppen. Für MiLight-Geräte kann in der Aktion definiert werden mit welchem Modus/Farbe/Helligkeit eingeschaltet werden soll. 17 | * Benutzerverwaltung: Identifikation anhand einer Client-Geräte-IP 18 | * Benutzerverwaltung: Für jeden Benutzer können individuelle Einstellungen wie Theme, Favoriten, Auto-Refresh usw. eingestellt werden 19 | * Audio-Feedback beim Betätigen bestimmter Buttons und dem Abschluss bestimmter Operationen 20 | 21 | ## Voraussetzungen: 22 | * Webserver mit Apache, PHP5 oder PHP7 (z.B. einen Raspberry Pi) 23 | * PHP-Curl-, PHP-MB-String, PHP-Sockets-, PHP-XML- und (optional) PHP-SSH-Modul werden benötigt 24 | * Benötigt keine Datenbank! 25 | 26 | ## Kompatible Hardware: 27 | * 433 MHz LAN-Gateway: Brematic Home Automation Gateway GWY 433 / Conn-Air 28 | * 433 MHz Funksteckdose: Brennenstuhl RCS 1000 N und viele andere von Elro, Intertechno, Brennenstuhl 29 | * FritzBox-Router mit FritzDect200-Steckdosen 30 | * MiLight RGBW-Lampen / RGBW-LED-Strip-Controller 31 | * MiLight RGBCCT-Lampen / RGBCCT-LED-Strip-Controller 32 | * MiLight LAN-Gateway bis einschließlich v5 33 | * [FB.MiLight-Hub](https://github.com/bombcheck/esp8266_milight_hub) (MiLight-Gateway auf Basis eines ESP8266) 34 | 35 | ## Installation: 36 | * Einfach in einen Ordner auf dem Webserver kopieren. 37 | * Webserver braucht Schreibrechte auf das data-Verzeichnis sowie dessen Unterverzeichnisse und aller Dateien. 38 | * Webserver braucht auch Schreibrechte auf das root-Verzeichnis der Installation. 39 | * Ggf. die Pfade in der Datei manifest.json anpassen (wird für Android benötigt). 40 | 41 | **Hinweis: Bitte bei der Benamung der Geräte, Gruppen usw. keine ":" und "|" verwenden!** 42 | 43 | Weitere Infos, Hilfe und Support gibt es im Forum: 44 | https://forum.bernis-hideout.de/viewforum.php?f=4 45 | -------------------------------------------------------------------------------- /countdowntimer.php: -------------------------------------------------------------------------------- 1 | message; 24 | } 25 | exit(4); 26 | } 27 | 28 | $timestamp = time(); 29 | $now = date("Y-m-d H:i",$timestamp); 30 | 31 | 32 | if((!isset($directaccess)) OR (!$directaccess)) die(); 33 | 34 | error_reporting(E_ALL ^ (E_NOTICE | E_WARNING)); 35 | 36 | $debug_timer=empty($xml->timers["debug"]) ? "false" : $xml->timers["debug"]; 37 | header("Content-Type: text/plain; charset=utf-8"); 38 | 39 | function countdowntimer_check() { 40 | 41 | 42 | global $xml; 43 | global $time_xml; 44 | global $debug_timer; 45 | 46 | $timeraktivenowon = false; 47 | $timeraktivenowoff = false; 48 | $timeraktive = false; 49 | $pingaktive = false; 50 | $timestamp = time(); 51 | $now = date("Y-m-d H:i",$timestamp); 52 | 53 | if($debug_timer=="true") debug_timer("Pruefe Countdowntimer...\n"); 54 | 55 | //Aktuelle Zeit ermitteln und Puffer definieren, die beim Timer berücksichtigt werden sollen 56 | // Timer auslesen und bei gefunden Timern Aktionen ausführen 57 | if(@count($time_xml->timer) <= '0' ){ 58 | debug_timer("Kein Countdowntimer gesetzt!\n"); 59 | return; 60 | } 61 | foreach ( $time_xml->timer as $user ) 62 | { 63 | echo 'Countdowntimer Nr: ' . $user->id . "\n"; 64 | echo 'Name: ' . $user->time . "\n"; 65 | echo 'DevID: ' .$user->device . "\n"; 66 | echo 'Action: '.$user->action . "\n \n"; 67 | 68 | $count = $user->time; 69 | 70 | if ($count == $now){ 71 | debug_timer("timer_switch ".$user->device." ".$user->action); 72 | $devicesFound = $xml->xpath("//devices/device/id[text()='".$user->device."']/parent::*"); 73 | $device = $devicesFound[0]; 74 | send_message($device, $user->action, TRUE); 75 | $device->status = $user->action; 76 | config_save("data/config.xml" , $xml); 77 | } 78 | if ($count <= $now ){ 79 | $xpath='//timer/id[.="'.$user->id.'"]/parent::*'; 80 | $res = $time_xml->xpath($xpath); 81 | $parent = $res[0]; 82 | unset($parent[0]); 83 | config_save($CONFIG_FILENAME , $time_xml); 84 | echo "Erfolgreich bereinigt\n"; 85 | } 86 | } 87 | } 88 | 89 | function countdowntimer_switch($timer, $action) { 90 | global $xml; 91 | global $debug_timer; 92 | debug_timer("timer_switch ".$timer->id." ".$action); 93 | // Timer mit Device 94 | $devicesFound = $xml->xpath("//devices/device/id[text()='".$timer->typeid."']/parent::*"); 95 | $device = $devicesFound[0]; 96 | send_message($device, $action, TRUE); 97 | } 98 | ?> 99 | -------------------------------------------------------------------------------- /edit_person.php: -------------------------------------------------------------------------------- 1 | persons->person as $person) { 27 | $oldid=(integer)$person->id; 28 | if($oldid >= $newid) { 29 | $newid = $oldid + 1; 30 | } 31 | } 32 | 33 | $r_favoritdevices = implode(",", $r_favoritdevices); 34 | $r_favoritgroups = implode(",", $r_favoritgroups); 35 | $r_favoritactions = implode(",", $r_favoritactions); 36 | 37 | $newdevice = $xml->persons->addChild('person'); 38 | $newdevice->addChild('id', $newid); 39 | $newdevice->addChild('name', $r_name); 40 | $newdevice->addChild('pingto', $r_pingto); 41 | $newdevice->addChild('theme', $r_theme); 42 | $newdevice->addChild('theme_bg', $r_theme_bg); 43 | $newdevice->addChild('ShowSettingsMenue', $r_ShowSettingsMenue); 44 | $newdevice->addChild('ShowFBdect200EnergyData', $r_ShowFBdect200EnergyData); 45 | $newdevice->addChild('AutoRefreshDeviceData', $r_AutoRefreshDeviceData); 46 | $newdevice->addChild('IndoorTempSource', $r_IndoorTempSource); 47 | $newdevice->addChild('favoritgroups', $r_favoritgroups); 48 | $newdevice->addChild('favoritactions', $r_favoritactions); 49 | $newdevice->addChild('favoritdevices', $r_favoritdevices); 50 | 51 | echo "ok"; 52 | config_save(); 53 | break; 54 | 55 | case "edit": 56 | 57 | $xpath='//person/id[.="'.$r_id.'"]/parent::*'; 58 | $res = $xml->xpath($xpath); 59 | $parent = $res[0]; 60 | 61 | $r_favoritdevices = implode(",", $r_favoritdevices); 62 | $r_favoritgroups = implode(",", $r_favoritgroups); 63 | $r_favoritactions = implode(",", $r_favoritactions); 64 | 65 | $parent[0]->id = $r_id; 66 | $parent[0]->name = $r_name; 67 | $parent[0]->pingto = $r_pingto; 68 | if ($r_pingto == "") $parent[0]->status = ""; 69 | $parent[0]->theme = $r_theme; 70 | $parent[0]->theme_bg = $r_theme_bg; 71 | $parent[0]->ShowSettingsMenue = $r_ShowSettingsMenue; 72 | $parent[0]->ShowFBdect200EnergyData = $r_ShowFBdect200EnergyData; 73 | $parent[0]->AutoRefreshDeviceData = $r_AutoRefreshDeviceData; 74 | $parent[0]->IndoorTempSource = $r_IndoorTempSource; 75 | $parent[0]->favoritgroups = $r_favoritgroups; 76 | $parent[0]->favoritactions = $r_favoritactions; 77 | $parent[0]->favoritdevices = $r_favoritdevices; 78 | 79 | echo "ok"; 80 | config_save(); 81 | break; 82 | 83 | case "delete": 84 | $xpath='//person/id[.="'.$r_id.'"]/parent::*'; 85 | $res = $xml->xpath($xpath); 86 | $parent = $res[0]; 87 | unset($parent[0]); 88 | echo "ok"; 89 | config_save(); 90 | break; 91 | 92 | default: 93 | echo "unsupported"; 94 | break; 95 | } 96 | ?> 97 | -------------------------------------------------------------------------------- /includes/incl_edit_groups.php: -------------------------------------------------------------------------------- 1 | 20 |
26 | 27 |
28 | Abbrechen'; 31 | echo'

Gruppe bearbeiten

'; 32 | }else{ 33 | echo 'Abbrechen'; 34 | echo'

Neue Gruppe

'; 35 | } ?> 36 | Speichern 37 |
38 | 39 |
40 | 41 | xpath($xpath); 45 | $parent = $res[0]; 46 | $data = array( 47 | 'id' => $parent->id, 48 | 'Groupname' => $parent->name, 49 | 50 | ); 51 | foreach($parent->deviceid as $deviceid) { 52 | array_push($data, (string)$deviceid); 53 | } 54 | 55 | } 56 | ?> 57 |
58 | 59 | 60 |
    61 |
  • 62 | 63 | 64 | 65 | 66 |
  • 67 |
  • 68 |
    69 | Geräte: 70 | devices->device as $device) { 73 | $devices[] = $device; 74 | } 75 | switch ($xml->gui->sortOrderDevices){ 76 | case "SORT_BY_NAME": 77 | usort($devices, "compareDevicesByName"); 78 | break; 79 | case "SORT_BY_ID": 80 | usort($devices, "compareDevicesByID"); 81 | break; 82 | default: 83 | break; 84 | } 85 | foreach($devices as $device ) { 86 | ?> 87 | id, $data)) ? 'checked="checked"' : '' ?> /> 88 | 89 | 92 |
    93 |
  • 94 | 95 | 96 |
97 |
98 |
99 |
100 | -------------------------------------------------------------------------------- /gui_debug.php: -------------------------------------------------------------------------------- 1 | 0) { 21 | $t = " "; 22 | while ($t != "\n") { 23 | if(fseek($handle, $pos, SEEK_END) == -1) { 24 | $beginning = true; break; 25 | } 26 | $t = fgetc($handle); 27 | $pos --; 28 | } 29 | $linecounter --; 30 | if($beginning) rewind($handle); 31 | $text[$lines-$linecounter-1] = fgets($handle); 32 | if($beginning) break; 33 | } 34 | fclose ($handle); 35 | // array_reverse is optional: you can also just return the $text array which consists of the file's lines. 36 | return array_reverse($text); 37 | //return $text; 38 | } 39 | 40 | 41 | if (isset($_GET['taillog'])) { 42 | header("Content-Type: text/plain; charset=utf-8"); 43 | foreach(read_file($DEBUG_FILENAME, 50) as $line) { 44 | echo $line; 45 | } 46 | } else { 47 | header("Content-Type: text/html; charset=utf-8"); 48 | ?> 49 | 50 | 51 | 52 | 53 | FB.Switch [Debug-Log] 54 | 55 | 56 | 57 | 58 | 59 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 |
104 | 105 |
106 | Einstellungen 107 |

Debug

108 | Reload 109 |
110 | 111 |
112 |
    113 | 114 |
  • 115 | debug.log 116 |
  • 117 | 118 |
  • 119 | 121 |
  • 122 | 123 |
124 |
125 |
126 | 127 | 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /configeditor.php: -------------------------------------------------------------------------------- 1 | 0) { 17 | chmod($CONFIG_FILENAME, 0666); 18 | echo "ok"; 19 | } else { 20 | echo "Konnte neue config.xml nicht speichern. Stelle Backup wieder her."; 21 | copy($configxmlbackup, $CONFIG_FILENAME); 22 | chmod($CONFIG_FILENAME, 0666); 23 | } 24 | } else { 25 | echo "Konnte kein Backup erstellen."; 26 | } 27 | } else { 28 | header("Content-Type: text/html; charset=utf-8"); 29 | ?> 30 | 31 | 32 | 33 | 34 | FB.Switch [Config-Editor] 35 | 36 | 37 | 38 | 39 | 40 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 |
88 | 89 |
90 | Abbrechen 91 |

Editor

92 |
93 | 94 | Speichern 95 |
96 |
97 | 98 |
99 |
    100 | 101 |
  • 102 |
    103 | 107 |
    108 |
  • 109 | 110 |
111 |
112 |
113 | 114 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /edit_device.php: -------------------------------------------------------------------------------- 1 | devices->device as $device) { 34 | $oldid=(integer)$device->id; 35 | if($oldid >= $newid) { 36 | $newid = $oldid + 1; 37 | } 38 | } 39 | 40 | $newdevice = $xml->devices->addChild('device'); 41 | 42 | if(!empty($r_btnLabelOn)) { 43 | $newdevice->addAttribute('buttonLabelOn', $r_btnLabelOn); 44 | } 45 | if(!empty($r_btnLabelOff)) { 46 | $newdevice->addAttribute('buttonLabelOff', $r_btnLabelOff); 47 | } 48 | 49 | $newdevice->addChild('id', $newid); 50 | $newdevice->addChild('name', $r_name); 51 | $newdevice->addChild('vendor', $r_vendor); 52 | $newdevice->addChild('sendCommandsOnlyOnce', $r_sendCommandsOnlyOnce); 53 | 54 | $newdeviceaddress = $newdevice->addChild('address'); 55 | $newdeviceaddress->addChild('masterdip', $r_masterdip); 56 | $newdeviceaddress->addChild('slavedip', $r_slavedip); 57 | $newdeviceaddress->addChild('tx433version', $r_tx433version); 58 | 59 | if($r_vendor == "url") { 60 | $newdeviceaddress->addChild('rawCodeOn', str_replace('&','&',$r_rawCodeOn)); 61 | $newdeviceaddress->addChild('rawCodeOff', str_replace('&','&',$r_rawCodeOff)); 62 | } else { 63 | $newdeviceaddress->addChild('rawCodeOn', $r_rawCodeOn); 64 | $newdeviceaddress->addChild('rawCodeOff', $r_rawCodeOff); 65 | } 66 | if(!empty($r_ssh_address)){ 67 | $newdeviceaddress->addChild('ssh_address', $r_ssh_address); 68 | $newdeviceaddress->addChild('ssh_user', $r_ssh_user); 69 | $newdeviceaddress->addChild('ssh_password', $r_ssh_password); 70 | } 71 | 72 | $newdevice->addChild('room', $r_room); 73 | $newdevice->addChild('senderid', $r_senderid); 74 | $newdevice->addChild('status', 'OFF'); 75 | $newdevice->addChild('showDeviceStatus', $r_showDeviceStatus); 76 | 77 | if(check_device($newdevice)) { 78 | echo "ok"; 79 | config_save(); 80 | } 81 | break; 82 | 83 | case "edit": 84 | 85 | $xpath='//device/id[.="'.$r_id.'"]/parent::*'; 86 | $res = $xml->xpath($xpath); 87 | $parent = $res[0]; 88 | 89 | 90 | if(!empty($r_btnLabelOn)) { 91 | #$parent[0]->addAttribute('buttonLabelOn', $r_btnLabelOn); 92 | $parent[0]['buttonLabelOn']= $r_btnLabelOn; 93 | }else{ 94 | unset ($parent[0]['buttonLabelOn']); 95 | } 96 | if(!empty($r_btnLabelOff)) { 97 | #$parent[0]->addAttribute('buttonLabelOff', $r_btnLabelOff); 98 | $parent[0]['buttonLabelOff']= $r_btnLabelOff; 99 | }else{ 100 | unset ($parent[0]['buttonLabelOff']); 101 | } 102 | $parent[0]->name = $r_name; 103 | $parent[0]->vendor = $r_vendor; 104 | $parent[0]->address->masterdip = $r_masterdip; 105 | $parent[0]->address->slavedip = $r_slavedip; 106 | $parent[0]->address->tx433version = $r_tx433version; 107 | $parent[0]->sendCommandsOnlyOnce = $r_sendCommandsOnlyOnce; 108 | if($r_vendor == "url") { 109 | $parent[0]->address->rawCodeOn = str_replace('&','&',$r_rawCodeOn); 110 | $parent[0]->address->rawCodeOff = str_replace('&','&',$r_rawCodeOff); 111 | } else { 112 | $parent[0]->address->rawCodeOn = $r_rawCodeOn; 113 | $parent[0]->address->rawCodeOff = $r_rawCodeOff; 114 | } 115 | if(!empty($r_ssh_address)){ 116 | $parent[0]->address->ssh_address = $r_ssh_address; 117 | $parent[0]->address->ssh_user = $r_ssh_user; 118 | $parent[0]->address->ssh_password = $r_ssh_password; 119 | } 120 | $parent[0]->room = $r_room; 121 | $parent[0]->senderid = $r_senderid; 122 | $parent[0]->status = 'OFF'; 123 | $parent[0]->showDeviceStatus = $r_showDeviceStatus; 124 | 125 | if(check_device($parent[0])) { 126 | echo "ok"; 127 | config_save(); 128 | } 129 | 130 | break; 131 | 132 | case "delete": 133 | $xpath='//device/id[.="'.$r_id.'"]/parent::*'; 134 | $res = $xml->xpath($xpath); 135 | $parent = $res[0]; 136 | unset($parent[0]); 137 | echo "ok"; 138 | config_save(); 139 | break; 140 | 141 | default: 142 | echo "unsupported"; 143 | break; 144 | } 145 | ?> 146 | -------------------------------------------------------------------------------- /edit_config.php: -------------------------------------------------------------------------------- 1 | timers["debug"] = $r_debug_timer; 62 | $xml->global->sendRaspi = $r_sendRaspi; 63 | $xml->global->timezone = $r_timezone; 64 | $xml->global->longitude = $r_longitude; 65 | $xml->global->latitude = $r_latitude; 66 | $xml->global->country = $r_country; 67 | $xml->global->plz = $r_plz; 68 | $xml->global->city = $r_city; 69 | $xml->connairs->connair->id = $r_connairID; 70 | $xml->connairs->connair->address = $r_connairIP; 71 | $xml->connairs->connair->port = $r_connairPort; 72 | $xml->connairs->connair->techdata = $r_connairTechData; 73 | $xml->milightwifis->milightwifi->id = $r_milightID; 74 | $xml->milightwifis->milightwifi->address = $r_milightIP; 75 | $xml->milightwifis->milightwifi->port = $r_milightPort; 76 | $xml->milightwifis->milightwifi->mac = $r_milightMAC; 77 | $xml->milighthubs->milighthub->id = $r_FBmilightID; 78 | $xml->milighthubs->milighthub->address = $r_FBmilightIP; 79 | $xml->milighthubs->milighthub->username = $r_FBmilightUsername; 80 | $xml->milighthubs->milighthub->password = $r_FBmilightPassword; 81 | $xml->fritzbox->address = $r_fritzboxAddress; 82 | $xml->fritzbox->username = $r_fritzboxUsername; 83 | $xml->fritzbox->password = $r_fritzboxPassword; 84 | $xml->global->multiDeviceSleep = $r_multiDeviceSleep; 85 | $xml->global->OutdoorTempSource = $r_OutdoorTempSource; 86 | $xml->global->timerGlobalRun = $r_timerGlobalRun; 87 | $xml->global->timerRunOnce = $r_timerRunOnce; 88 | $xml->global->timerPingUser = $r_timerPingUser; 89 | $xml->global->timerCheckFBdect200 = $r_timerCheckFBdect200; 90 | // $xml->global->installpath = __DIR__; 91 | if(check_config_global()) { 92 | echo "ok"; 93 | config_save(); 94 | } 95 | break; 96 | 97 | case "editdesign": 98 | //$xml->gui->showDeviceStatus = $r_showDeviceStatus; 99 | $xml->gui->showRoomButtonInDevices = $r_showRoomButtonInDevices; 100 | $xml->gui->showMenuOnLoad = $r_showMenuOnLoad; 101 | $xml->gui->showTimerBtnInMenu = $r_showTimerBtnInMenu; 102 | $xml->gui->showActionBtnInMenu = $r_showActionBtnInMenu; 103 | $xml->gui->showRoomsBtnInMenu = $r_showRoomsBtnInMenu; 104 | $xml->gui->showGroupsBtnInMenu = $r_showGroupsBtnInMenu; 105 | $xml->gui->showAllOnOffBtnInMenu = $r_showAllOnOffBtnInMenu; 106 | $xml->gui->playSounds = $r_playSounds; 107 | $xml->gui->showSplashAnimation = $r_showSplashAnimation; 108 | $xml->gui->sortOrderDevices = $r_sortOrderDevices; 109 | $xml->gui->sortOrderGroups = $r_sortOrderGroups; 110 | $xml->gui->sortOrderRooms = $r_sortOrderRooms; 111 | $xml->gui->sortOrderTimers = $r_sortOrderTimers; 112 | //$xml->gui->theme_mobile = $r_theme_mobile; 113 | //$xml->gui->theme_desktop = $r_theme_desktop; 114 | //$xml->gui->theme_desktop_bg = $r_theme_desktop_bg; 115 | if(check_config_global()) { 116 | echo "ok"; 117 | config_save(); 118 | } 119 | break; 120 | 121 | case "rebootconnair": 122 | foreach($xml->connairs->connair as $connair) { 123 | $server_ip = (string)$connair->address; 124 | $server_port = (string)$connair->port; 125 | $message = 'rebooting.cgi?restart=true&Submit=REBOOT'; 126 | 127 | if ($socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP)) { 128 | socket_sendto($socket, $message, strlen($message), 0, $server_ip, $server_port); 129 | echo "ok"; 130 | } 131 | else echo "socket_create FAILED"; 132 | } 133 | break; 134 | default: 135 | echo "action unsupported"; 136 | break; 137 | } 138 | ?> 139 | -------------------------------------------------------------------------------- /gui.php: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | FB.Switch 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | gui->showSplashAnimation=="true" || $xml->gui->showSplashAnimation=="") { ?> 50 | 51 |
52 | 53 | 54 |
55 | 56 |
57 |
58 |
59 |
60 |

61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | 73 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 |
88 | gui->showGroupsBtnInMenu == "true") require_once('includes/incl_groups.php'); 97 | // Räume 98 | if($xml->gui->showRoomsBtnInMenu == "true") require_once('includes/incl_rooms.php'); 99 | // Aktionen 100 | if($xml->gui->showActionBtnInMenu == "true") require_once('includes/incl_actions.php'); 101 | // Timer 102 | if($xml->gui->showTimerBtnInMenu == "true") require_once('includes/incl_timer.php'); 103 | // Geräteeditor 104 | require_once('includes/incl_edit_devs.php'); 105 | // Gruppeneditor 106 | if($xml->gui->showGroupsBtnInMenu == "true") require_once('includes/incl_edit_groups.php'); 107 | // Timereditor 108 | if($xml->gui->showTimerBtnInMenu == "true") require_once('includes/incl_edit_timer.php'); 109 | // Einstellungen 110 | if($ShowSettingsMenue == "true") require_once('includes/incl_settings.php'); 111 | // Desing-Einstellungen 112 | if($ShowSettingsMenue == "true") require_once('includes/incl_settings_design.php'); 113 | // Benutzerverwaltung 114 | if($ShowSettingsMenue == "true") require_once('includes/incl_settings_user.php'); 115 | // Debug 116 | require_once('includes/incl_debug.php'); 117 | ?> 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | POST 15 | if (isset($_POST['action'])) { 16 | $r_action = (string)$_POST['action']; 17 | $r_type = (string)$_POST['type']; 18 | $r_id = (string)$_POST['id']; 19 | } 20 | // Über Linkfunktion -> GET 21 | if (isset($_GET['action'])) { 22 | $r_action = (string)$_GET['action']; 23 | $r_type = (string)$_GET['type']; 24 | $r_id = (string)$_GET['id']; 25 | if (isset($_GET['async'])) { 26 | async_curl('http://localhost'.$_SERVER[PHP_SELF]."?action=".$r_action."&type=".$r_type."&id=".$r_id); 27 | echo "Async-Aufruf registriert: ". $_SERVER[PHP_SELF]."?action=".$r_action."&type=".$r_type."&id=".$r_id; 28 | exit(); 29 | } 30 | 31 | if($r_action == "toggle" and $r_type == "device"){ 32 | $xpath='//device/id[.="'.$r_id.'"]/parent::*'; 33 | $res = $xml->xpath($xpath); 34 | $parent = $res[0]; 35 | if($parent[0]->status == "OFF"){ 36 | $r_action = "on"; 37 | }elseif($parent[0]->status == "ON"){ 38 | $r_action = "off"; 39 | } 40 | } 41 | 42 | if($r_action == "status" and $r_type == "device"){ 43 | $xpath='//device/id[.="'.$r_id.'"]/parent::*'; 44 | $res = $xml->xpath($xpath); 45 | $parent = $res[0]; 46 | if($parent[0]->status == "OFF"){ 47 | echo "0"; 48 | }elseif($parent[0]->status == "ON"){ 49 | echo "1"; 50 | } 51 | exit(); 52 | } 53 | } 54 | if (isset($_POST['todo'])) { 55 | if ($_POST['todo'] == "sendmilight" || $_POST['todo'] == "sendmilightrgbcct") { 56 | $r_MLid = (string)$_POST['id']; 57 | $r_MLcmd = (string)$_POST['command']; 58 | $r_MLval = (string)$_POST['value']; 59 | } 60 | } 61 | 62 | // Über Timerfunktion -> GET 63 | if (isset($_GET['timerrun'])) { 64 | require("send_msg.php"); 65 | require("timer.php"); 66 | include("countdowntimer.php"); 67 | if ($xml->global->timerGlobalRun != "false" && $xml->global->AlertState != "red") timer_check(); 68 | ping_check(); 69 | if ($xml->global->AlertState != "red") countdowntimer_check(); 70 | fbdect_check(); 71 | exit(); 72 | } 73 | 74 | if (isset($r_action)) { 75 | debug("Running in action='".$r_action."'"); 76 | 77 | require("send_msg.php"); 78 | 79 | if (($r_action)=="alloff") { 80 | foreach($xml->devices->device as $device) { 81 | send_message($device, "OFF"); 82 | usleep($multiDeviceSleep); 83 | } 84 | //echo str_replace("\n","
",$errormessage); 85 | echo $errormessage; 86 | 87 | } else if (($r_action)=="allon") { 88 | foreach($xml->devices->device as $device) { 89 | send_message($device, "ON"); 90 | usleep($multiDeviceSleep); 91 | } 92 | //echo str_replace("\n","
",$errormessage); 93 | echo $errormessage; 94 | 95 | } else { 96 | if (($r_action)=="on") { 97 | $action="ON"; 98 | }else { 99 | $action="OFF"; 100 | } 101 | 102 | if (($r_type)=="device") { 103 | send_message_device($r_id, $action); 104 | 105 | } else if (($r_type)=="room") { 106 | send_message_room($r_id, $action); 107 | 108 | } else if (($r_type)=="group") { 109 | send_message_group($r_id, $action); 110 | 111 | } else if (($r_type)=="action") { 112 | $actionsFound = $xml->xpath("//actions/action/id[text()='".$r_id."']/parent::*"); 113 | foreach($actionsFound[0]->do as $do) { 114 | debug("Action: type:".$do['type']." id:".$do['id']." action:".$do['action']); 115 | switch ($do['type']) { 116 | case "device": 117 | send_message_device($do['id'], $do['action'], TRUE, $do['mode'], $do['color'], $do['brightness'], $actionsFound[0]->name); 118 | usleep($multiDeviceSleep); 119 | break; 120 | case "room": 121 | send_message_room($do['id'], $do['action'], TRUE, $actionsFound[0]->name); 122 | break; 123 | case "group": 124 | send_message_group($do['id'], strtoupper($do['action']), TRUE, $actionsFound[0]->name); 125 | break; 126 | case "wait": 127 | debug("Action: Schlafe jetzt ".$do['id']." Sekunden"); 128 | sleep(intval($do['id'])); 129 | debug("Action: Wieder wach!"); 130 | break; 131 | } 132 | } 133 | } else if (($r_type)=="timerglobalrun") { 134 | if ($action == "ON") { 135 | if ($xml->global->timerGlobalRun == "true") $errormessage = "FEHLER: Globaler Timer ist bereits aktiviert!"; 136 | else { $xml->global->timerGlobalRun = "true"; $errormessage = "Globaler Timer wurde aktiviert!"; LogToBackend('info','Global Timer ENABLED','false',false,false); } 137 | } 138 | else if ($action == "OFF") { 139 | if ($xml->global->timerGlobalRun == "false") $errormessage = "FEHLER: Globaler Timer ist bereits deaktiviert!"; 140 | else { $xml->global->timerGlobalRun = "false"; $errormessage = "Globaler Timer wurde deaktiviert!"; LogToBackend('info','Global Timer DISABLED','false',false,false); } 141 | } 142 | } else if (($r_type)=="alertstate") { 143 | if ($action == "ON") { 144 | if ($xml->global->AlertState == "red") $errormessage = "FEHLER: System-Alarm wurde bereits ausgelöst!"; 145 | else { $xml->global->AlertState = "red"; $errormessage = "System-Alarm wurde ausgelöst!"; async_curl('http://localhost'.str_replace('index.php', 'redalert.php', $_SERVER[PHP_SELF])); LogToBackend('info','System-Alert TRIGGERED','false',false,false); } 146 | } 147 | else if ($action == "OFF") { 148 | if ($xml->global->AlertState == "green") $errormessage = "FEHLER: System-Alarm wurde bereits aufgehoben!"; 149 | else { $xml->global->AlertState = "green"; $errormessage = "System-Alarm wurde aufgehoben!"; LogToBackend('info','System-Alert DISABLED','false',false,false); } 150 | } 151 | } 152 | //echo str_replace("\n","
",$errormessage); 153 | echo $errormessage; 154 | } 155 | config_save(); 156 | } 157 | elseif (isset($r_MLcmd)) { 158 | require("send_msg.php"); 159 | debug("Executing MiLight-Command '".$r_MLcmd."' for Device-ID '".$r_MLid."'"); 160 | if ($_POST['todo'] == "sendmilight" ) { 161 | echo toggle_milight($r_MLid,$r_MLcmd,$r_MLval); 162 | } elseif ($_POST['todo'] == "sendmilightrgbcct") { 163 | echo toggle_fbmilighthub($r_MLid,$r_MLcmd,$r_MLval,"rgb_cct"); 164 | } 165 | config_save(); 166 | } 167 | else { 168 | debug("Sending HTML Site"); 169 | require("gui.php"); 170 | } 171 | //debug("END"); 172 | ?> 173 | -------------------------------------------------------------------------------- /includes/incl_functions.php: -------------------------------------------------------------------------------- 1 | 100) return $MilightRgbcctMinKelvin; 7 | global $MilightRgbcctMinKelvin,$MilightRgbcctMaxKelvin; 8 | $Diff = $MilightRgbcctMaxKelvin - $MilightRgbcctMinKelvin; 9 | $KelvinPerPercent = $Diff / 100; 10 | $val = $KelvinPerPercent * $percent; 11 | return $MilightRgbcctMaxKelvin - $val; 12 | } 13 | function colorHEXtoRGB($hex) { 14 | list($r, $g, $b) = sscanf($hex, "#%02x%02x%02x"); 15 | return array("R"=>$r, "G"=>$g, "B"=>$b); 16 | } 17 | function compareDevicesByName($a, $b) { 18 | return strcmp($a->name,$b->name); 19 | } 20 | function compareDevicesByID($a, $b) { 21 | return strcmp($a->id,$b->id); 22 | } 23 | function compareDevicesByRoom($a, $b) { 24 | return strcmp($a->room,$b->room); 25 | } 26 | function compareGroupsByName($a, $b) { 27 | return strcmp($a->name,$b->name); 28 | } 29 | function compareGroupsByID($a, $b) { 30 | return strcmp($a->id,$b->id); 31 | } 32 | function compareTimersByTypeAndName($a, $b) { 33 | global $xml; 34 | switch($a->type) { 35 | case "device": 36 | $devicesFound = $xml->xpath("//devices/device/id[text()='".$a->typeid."']/parent::*"); 37 | $deviceA = $devicesFound[0]; 38 | $nameA = $deviceA->name; 39 | break; 40 | case "group": 41 | $groupsFound = $xml->xpath("//groups/group/id[text()='".$a->typeid."']/parent::*"); 42 | $groupA = $groupsFound[0]; 43 | $nameA = $groupA->name; 44 | break; 45 | case "room": 46 | $nameA = $a->typeid; 47 | break; 48 | default: 49 | $nameA = $a->id; 50 | break; 51 | } 52 | switch($b->type) { 53 | case "device": 54 | $devicesFound = $xml->xpath("//devices/device/id[text()='".$b->typeid."']/parent::*"); 55 | $deviceB = $devicesFound[0]; 56 | $nameB = $deviceB->name; 57 | break; 58 | case "group": 59 | $groupsFound = $xml->xpath("//groups/group/id[text()='".$b->typeid."']/parent::*"); 60 | $groupB = $groupsFound[0]; 61 | $nameB = $groupB->name; 62 | break; 63 | case "room": 64 | $nameB = $b->typeid; 65 | break; 66 | default: 67 | $nameB = $b->id; 68 | break; 69 | } 70 | return strcmp($nameA,$nameB); 71 | } 72 | function compareTimersByID($a, $b) { 73 | return strcmp($a->id,$b->id); 74 | } 75 | function compareTimersByType($a, $b) { 76 | $cmp = strcmp($a->type,$b->type); 77 | if($cmp == 0) { 78 | $cmp = compareTimersByName($a, $b); 79 | } 80 | return $cmp; 81 | } 82 | function compareTimersByName($a, $b) { 83 | return strcmp($a->name,$b->name); 84 | } 85 | 86 | function send_message_device($deviceid, $action, $ViaTimer = FALSE, $MLMode = "", $MLColor = "", $MLBrightness = "", $ViaAction = FALSE) { 87 | global $xml; 88 | $devicesFound = $xml->xpath("//devices/device/id[text()='".$deviceid."']/parent::*"); 89 | $device = $devicesFound[0]; 90 | send_message($device, strtoupper($action), $ViaTimer, $MLMode, $MLColor, $MLBrightness, $ViaAction); 91 | } 92 | 93 | function send_message_room($room, $action, $ViaTimer = FALSE, $ViaAction = FALSE) { 94 | global $xml; 95 | global $multiDeviceSleep; 96 | $devicesFound = $xml->xpath("//devices/device/room[text()='".$room."']/parent::*"); 97 | foreach($devicesFound as $device) { 98 | send_message($device, strtoupper($action), $ViaTimer, "", "", "", $ViaAction); 99 | usleep($multiDeviceSleep); 100 | } 101 | } 102 | 103 | function send_message_group($groupid, $action, $ViaTimer = FALSE, $ViaAction = FALSE) { 104 | global $xml; 105 | global $multiDeviceSleep; 106 | $groupsFound = $xml->xpath("//groups/group/id[text()='".$groupid."']/parent::*"); 107 | foreach($groupsFound[0]->deviceid as $deviceid) { 108 | $devicesFound = $xml->xpath("//devices/device/id[text()='".$deviceid."']/parent::*"); 109 | $device = $devicesFound[0]; 110 | if($action == "ON") { 111 | if(empty($deviceid['onaction'])) { 112 | send_message($device, strtoupper($action), $ViaTimer, "", "", "", $ViaAction); 113 | } else { 114 | switch ($deviceid['onaction']) { 115 | case "on": 116 | send_message($device, "ON", $ViaTimer, "", "", "", $ViaAction); 117 | break; 118 | case "off": 119 | send_message($device, "OFF", $ViaTimer, "", "", "", $ViaAction); 120 | break; 121 | case "none": 122 | break; 123 | } 124 | } 125 | } else if($action == "OFF") { 126 | if(empty($deviceid['offaction'])) { 127 | send_message($device, strtoupper($action), $ViaTimer, "", "", "", $ViaAction); 128 | } else { 129 | switch ($deviceid['offaction']) { 130 | case "on": 131 | send_message($device, "ON", $ViaTimer, "", "", "", $ViaAction); 132 | break; 133 | case "off": 134 | send_message($device, "OFF", $ViaTimer, "", "", "", $ViaAction); 135 | break; 136 | case "none": 137 | break; 138 | } 139 | } 140 | } 141 | usleep($multiDeviceSleep); 142 | } 143 | } 144 | 145 | function LogToBackend($type,$logtext,$WAnotify,$ViaTimer,$ViaAction) { 146 | global $xml,$active_user; 147 | $FBnet_BEurl = $xml->backend->url; 148 | $FBnet_SIDsource = $xml->backend->sidsource; 149 | 150 | if ($FBnet_BEurl != "" && $FBnet_SIDsource != "" && $xml->backend->logging == "true") { 151 | $SID = file_get_contents($FBnet_SIDsource); 152 | $TextToLog = $logtext; 153 | if ($ViaTimer == TRUE && $ViaAction == FALSE) { 154 | $TextToLog .= " from TIMER"; 155 | } 156 | elseif ($ViaTimer == TRUE && $ViaAction == TRUE) { 157 | $TextToLog .= " from ACTION ".$ViaAction."@"; 158 | if ($active_user != "false") $TextToLog .= $active_user->name; 159 | else $TextToLog .= $xml->persons->person->name; 160 | } 161 | else { 162 | if ($active_user != "false") $TextToLog .= " from ".$active_user->name; 163 | else $TextToLog .= " from ".$xml->persons->person->name; 164 | } 165 | $task="LogAction";$params=$xml->global->FBnetDeviceID."|".$type."|".urlencode($TextToLog)."|".$WAnotify; 166 | 167 | $ret = file_get_contents($FBnet_BEurl."?task=".$task."&sid=".$SID."¶ms=".$params); 168 | if ($ret === FALSE) $ret = "Backend unreachable!"; 169 | if (strpos($ret,'#OK#') !== FALSE) return(TRUE); 170 | else return($ret); 171 | } 172 | else return('Disabled'); 173 | } 174 | 175 | function async_curl($background_process=''){ 176 | $ch = curl_init($background_process); 177 | curl_setopt_array($ch, array( 178 | CURLOPT_HEADER => 0, 179 | CURLOPT_RETURNTRANSFER =>true, 180 | CURLOPT_NOSIGNAL => 1, //to timeout immediately if the value is < 1000 ms 181 | CURLOPT_TIMEOUT_MS => 50, //The maximum number of mseconds to allow cURL functions to execute 182 | CURLOPT_VERBOSE => 1, 183 | CURLOPT_HEADER => 1 184 | )); 185 | $out = curl_exec($ch); 186 | curl_close($ch); 187 | return true; 188 | } 189 | ?> -------------------------------------------------------------------------------- /edit_timer.php: -------------------------------------------------------------------------------- 1 | 23) { 72 | echo "Falsche Stunden"; 73 | exit; 74 | } 75 | $onMM=$_POST['OnTimerMM']; 76 | if($onHH<0 && $onHH>59) { 77 | echo "Falsche Minuten"; 78 | exit; 79 | } 80 | $timerOn = $onHH.':'.$onMM; 81 | break; 82 | 83 | case "SU": 84 | case "SD": 85 | $timerOn = (string)$_POST['OnTimerType']; 86 | break; 87 | 88 | default: 89 | case "M": 90 | $timerOn = ""; 91 | break; 92 | } 93 | $r_timeronoffset=intval($_POST['timeronoffset']); 94 | switch($_POST['OffTimerType']) { 95 | case "A": 96 | $offHH=$_POST['OffTimerHH']; 97 | if($offHH<0 && $offHH>23) { 98 | echo "Falsche Stunden"; 99 | exit; 100 | } 101 | $offMM=$_POST['OffTimerMM']; 102 | if($offHH<0 && $offHH>59) { 103 | echo "Falsche Minuten"; 104 | exit; 105 | } 106 | $timerOff = $offHH.':'.$offMM; 107 | break; 108 | 109 | case "SU": 110 | case "SD": 111 | $timerOff = (string)$_POST['OffTimerType']; 112 | break; 113 | 114 | default: 115 | case "M": 116 | $timerOff = ""; 117 | break; 118 | } 119 | $r_timeroffoffset=intval($_POST['timeroffoffset']); 120 | 121 | $newid=1; 122 | foreach($xml->timers->timer as $timer) { 123 | $oldid=(integer)$timer->id; 124 | if($oldid >= $newid) { 125 | $newid = $oldid + 1; 126 | } 127 | } 128 | $newtimer = $xml->timers->addChild('timer'); 129 | $newtimer->addChild('id', $newid); 130 | $newtimer->addChild('active', $r_active); 131 | $newtimer->addChild('type', $r_type); 132 | $newtimer->addChild('typeid', $typeid); 133 | $newtimer->addChild('day', $day); 134 | $newtimer->addChild('pingstatus', $r_pingstatus); 135 | $newtimer->addChild('invertSwitchOnNoPing', $r_invertSwitchOnNoPing); 136 | $newtimer->addChild('usage', $r_usage); 137 | $newtimer->addChild('pingto', $r_pingto); 138 | 139 | $timerOnXml=$newtimer->addChild('timerOn', $timerOn); 140 | if(!empty($r_timeronoffset)) { 141 | $timerOnXml->addAttribute('offset', $r_timeronoffset); 142 | } 143 | $timerOffXml=$newtimer->addChild('timerOff', $timerOff); 144 | if(!empty($r_timeroffoffset)) { 145 | $timerOffXml->addAttribute('offset', $r_timeroffoffset); 146 | } 147 | 148 | if(check_timer($newtimer)) { 149 | echo "ok"; 150 | config_save(); 151 | } 152 | 153 | break; 154 | 155 | case "edit": 156 | 157 | $r_active = (string)$_POST['active']; 158 | $r_type = (string)$_POST['timertype']; 159 | $r_pingstatus = (string)$_POST['pingstatus']; 160 | $r_invertSwitchOnNoPing = (string)$_POST['invertSwitchOnNoPing']; 161 | $r_usage = (string)$_POST['usage']; 162 | $r_pingto = (string)$_POST['pingto']; 163 | 164 | switch($_POST['timertype']) { 165 | case "device": 166 | $typeid = (string)$_POST['typeiddevice']; 167 | break; 168 | 169 | case "group": 170 | $typeid = (string)$_POST['typeidgroup']; 171 | break; 172 | 173 | case "room": 174 | $typeid = (string)$_POST['typeidroom']; 175 | break; 176 | 177 | default: 178 | echo "Ungültiger Typer Typ!"; 179 | exit; 180 | } 181 | 182 | $day = '_______'; 183 | foreach ($_POST['timerday'] as $keyday) { 184 | switch($keyday) { 185 | case 0: 186 | $day[$keyday]='M'; 187 | break; 188 | case 1: 189 | $day[$keyday]='D'; 190 | break; 191 | case 2: 192 | $day[$keyday]='M'; 193 | break; 194 | case 3: 195 | $day[$keyday]='D'; 196 | break; 197 | case 4: 198 | $day[$keyday]='F'; 199 | break; 200 | case 5: 201 | $day[$keyday]='S'; 202 | break; 203 | case 6: 204 | $day[$keyday]='S'; 205 | break; 206 | } 207 | } 208 | 209 | switch($_POST['OnTimerType']) { 210 | case "A": 211 | $onHH=$_POST['OnTimerHH']; 212 | if($onHH<0 && $onHH>23) { 213 | echo "Falsche Stunden"; 214 | exit; 215 | } 216 | $onMM=$_POST['OnTimerMM']; 217 | if($onHH<0 && $onHH>59) { 218 | echo "Falsche Minuten"; 219 | exit; 220 | } 221 | $timerOn = $onHH.':'.$onMM; 222 | break; 223 | 224 | case "SU": 225 | case "SD": 226 | $timerOn = (string)$_POST['OnTimerType']; 227 | break; 228 | 229 | default: 230 | case "M": 231 | $timerOn = ""; 232 | break; 233 | } 234 | $r_timeronoffset=intval($_POST['timeronoffset']); 235 | switch($_POST['OffTimerType']) { 236 | case "A": 237 | $offHH=$_POST['OffTimerHH']; 238 | if($offHH<0 && $offHH>23) { 239 | echo "Falsche Stunden"; 240 | exit; 241 | } 242 | $offMM=$_POST['OffTimerMM']; 243 | if($offHH<0 && $offHH>59) { 244 | echo "Falsche Minuten"; 245 | exit; 246 | } 247 | $timerOff = $offHH.':'.$offMM; 248 | break; 249 | 250 | case "SU": 251 | case "SD": 252 | $timerOff = (string)$_POST['OffTimerType']; 253 | break; 254 | 255 | default: 256 | case "M": 257 | $timerOff = ""; 258 | break; 259 | } 260 | $r_timeroffoffset=intval($_POST['timeroffoffset']); 261 | 262 | 263 | $xpath='//timer/id[.="'.$r_id.'"]/parent::*'; 264 | $res = $xml->xpath($xpath); 265 | $parent = $res[0]; 266 | $parent[0]->active = $r_active; 267 | $parent[0]->type = $r_type; 268 | $parent[0]->typeid = $typeid; 269 | $parent[0]->day = $day; 270 | $parent[0]->pingstatus = $r_pingstatus; 271 | $parent[0]->invertSwitchOnNoPing = $r_invertSwitchOnNoPing; 272 | $parent[0]->usage = $r_usage; 273 | $parent[0]->pingto = $r_pingto; 274 | $parent[0]->timerOn = $timerOn; 275 | if(!empty($r_timeronoffset)) { 276 | //$timerOnXml->addAttribute('offset', $r_timeronoffset); 277 | $parent[0]->timerOn['offset'] = $r_timeronoffset; 278 | }else{ 279 | unset($parent[0]->timerOn['offset']); 280 | } 281 | $parent[0]->timerOff = $timerOff; 282 | if(!empty($r_timeroffoffset)) { 283 | $parent[0]->timerOff['offset'] = $r_timeroffoffset; 284 | }else{ 285 | unset($parent[0]->timerOff['offset']); 286 | } 287 | 288 | echo "ok"; 289 | $dom = new DOMDocument('1.0'); 290 | $dom->preserveWhiteSpace = false; 291 | $dom->formatOutput = true; 292 | $dom->loadXML($xml->asXML()); 293 | $dom->save($CONFIG_FILENAME); 294 | 295 | break; 296 | 297 | case "on": 298 | $xpath='//timer/id[.="'.$r_id.'"]/parent::*'; 299 | $res = $xml->xpath($xpath); 300 | $parent = $res[0]; 301 | $parent[0]->active="on"; 302 | echo "ok"; 303 | config_save(); 304 | break; 305 | 306 | case "off": 307 | $xpath='//timer/id[.="'.$r_id.'"]/parent::*'; 308 | $res = $xml->xpath($xpath); 309 | $parent = $res[0]; 310 | $parent[0]->active="off"; 311 | echo "ok"; 312 | config_save(); 313 | break; 314 | 315 | case "delete": 316 | $xpath='//timer/id[.="'.$r_id.'"]/parent::*'; 317 | $res = $xml->xpath($xpath); 318 | $parent = $res[0]; 319 | unset($parent[0]); 320 | echo "ok"; 321 | config_save(); 322 | break; 323 | 324 | default: 325 | echo "unsupported"; 326 | break; 327 | } 328 | ?> 329 | -------------------------------------------------------------------------------- /includes/incl_groups.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 | Favoriten 6 | 7 | Geräte 8 | gui->showGroupsBtnInMenu == "true") { ?> Gruppen 9 | gui->showRoomsBtnInMenu == "true") { ?> Räume 10 | gui->showTimerBtnInMenu == "true") { ?> Timer 11 | gui->showActionBtnInMenu == "true") { ?> Aktionen 12 | Einstellungen 13 |
14 | gui->showAllOnOffBtnInMenu == "true") { ?> 15 |
16 |
17 |
18 |
19 |
20 | 21 | Schliessen 22 |
23 |
24 | 25 |
26 | Menu 27 |

Gruppen

28 |
29 | 30 | 31 | 32 |
33 |
34 | 35 | 46 | 47 |
48 | 49 |
    50 | 57 |
  • background-color:#B63737;-moz-border-radius:.5em;-webkit-border-radius:.5em;border-radius:.5em;"> 58 |
    59 |
    60 |

    61 |
    62 |
    63 |
  • 64 | 74 | groups->group as $group) { 77 | $groups[] = $group; 78 | } 79 | switch ($xml->gui->sortOrderGroups){ 80 | case "SORT_BY_NAME": 81 | usort($groups, "compareGroupsByName"); 82 | break; 83 | case "SORT_BY_ID": 84 | usort($groups, "compareGroupsByID"); 85 | break; 86 | default: 87 | break; 88 | } 89 | foreach($groups as $group) { 90 | ?> 91 | 92 |
  • 93 |
    94 |
    95 |

    name; ?>

    96 | deviceid as $deviceid) { 98 | $devicesFound = $xml->xpath("//devices/device/id[text()='".$deviceid."']/parent::*"); 99 | $device = $devicesFound[0]; 100 | $text = $device->name; 101 | if(!empty($deviceid['onaction'])) { 102 | if($deviceid['onaction'] == "on") { 103 | $text = $text." [ on ]"; 104 | } else if($deviceid['onaction'] == "off") { 105 | $text = $text." [ off ]"; 106 | } else if($deviceid['onaction'] == "none") { 107 | $text = $text." [ none ]"; 108 | } 109 | } 110 | if(!empty($deviceid['offaction'])) { 111 | if($deviceid['offaction'] == "on") { 112 | $text = $text." [ on ]"; 113 | } else if($deviceid['offaction'] == "off") { 114 | $text = $text." [ off ]"; 115 | } else if($deviceid['offaction'] == "none") { 116 | $text = $text." [ none ]"; 117 | } 118 | } 119 | echo "

    ".$text."

    "; 120 | } 121 | ?> 122 |
    123 |
    124 |
    125 | 126 | 127 |
    128 |
    129 | 130 | 131 |
    132 |
    133 |
    134 |
  • 135 | 136 | 139 | 140 |
141 |
142 |
143 | -------------------------------------------------------------------------------- /includes/incl_settings_design.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 |

Design

6 | Speichern 7 |
8 | 9 |
10 |
11 | 12 |
    13 |
  • 14 | Welche Bereiche anzeigen? 15 |
  • 16 |
  • 17 | 18 | 22 |
  • 23 |
  • 24 | 25 | 29 |
  • 30 |
  • 31 | 32 | 36 |
  • 37 |
  • 38 | 39 | 43 |
  • 44 |
  • 45 | Allgemeine GUI-Einstellungen 46 |
  • 47 | 56 |
  • 57 | 58 | 62 |
  • 63 |
  • 64 | 65 | 69 |
  • 70 |
  • 71 | 72 | 76 |
  • 77 |
  • 78 | 79 | 83 |
  • 84 |
  • 85 | 86 | 90 |
  • 91 |
  • 92 | 93 | 98 |
  • 99 |
  • 100 | 101 | 105 |
  • 106 |
  • 107 | 108 | 112 |
  • 113 |
  • 114 | 115 | 121 |
  • 122 |
123 |
124 |
125 |
126 | -------------------------------------------------------------------------------- /fritzbox.inc.php: -------------------------------------------------------------------------------- 1 | backend->url; 11 | if ($FBnet_BEurl != "") { 12 | if ($wert == 1) $SV = 0; 13 | elseif ($wert == 0) $SV = 1; 14 | $task="ToggleActor";$params=$deviceain."|".$SV."|".$xml->global->FBnetDeviceID."|FALSE"; 15 | debug("Fritzbox_DECT200 (via BE-Call): ".$params); 16 | 17 | $ret = file_get_contents($FBnet_BEurl."?task=".$task."&sid=".$SID."¶ms=".$params); 18 | if ($ret === FALSE) $ret = "Backend unreachable!"; 19 | if (strpos($ret,'#OK#') !== FALSE) return($wert); 20 | else return($ret); 21 | } 22 | else { 23 | $fritzbox_address = $xml->fritzbox->address; 24 | $SwitchCMD=""; 25 | if ($wert == 1) $SwitchCMD="setswitchon"; 26 | elseif ($wert == 0) $SwitchCMD="setswitchoff"; 27 | 28 | debug("Fritzbox_DECT200 (via Direct-Call): ".$SID); 29 | if($SID <> "Fehler: Login fehlgeschlagen" && $SID != "") { 30 | $Value=Fritzbox_GetSetHAactor($fritzbox_address,$SwitchCMD,$SID,$deviceain); 31 | } else { 32 | $Value=$SID; 33 | } 34 | return($Value); 35 | } 36 | } 37 | 38 | /* function Fritzbox_DECT200_Energie($deviceid, $Zeit) { 39 | global $xml; 40 | $fritzbox_address = $xml->fritzbox->address; 41 | $Daten=""; 42 | $SID=Fritzbox_login(); 43 | if ($SID <> "Fehler: Login fehlgeschlagen") { 44 | switch($Zeit) { 45 | case 1: // Abfrage der Messwerte der letzten 10 min 46 | $Daten= file("http://".$fritzbox_address."/net/home_auto_query.lua?sid=". $SID. "&command=EnergyStats_10&id=". $deviceid. "&xhr=1"); 47 | break; 48 | case 2: // Abfrage der Messwerte der letzten 24h 49 | $Daten= file("http://".$fritzbox_address."/net/home_auto_query.lua?sid=". $SID. "&command=EnergyStats_24h&id=". $deviceid. "&xhr=1"); 50 | break; 51 | } 52 | if($Daten <>"") { 53 | $Daten=explode('" , "', $Daten[1]); 54 | $x=count($Daten)-1; 55 | $temp=explode('" ,"', $Daten[$x]); 56 | foreach ($temp as $tem) { 57 | $Daten[$x]=$tem; 58 | $x++; 59 | } 60 | } else { 61 | $Daten[0]="Keine Werte vorhanden"; 62 | } 63 | return ($Daten); 64 | } 65 | } */ 66 | 67 | function Fritzbox_GetHAactorsInfoXML() 68 | { 69 | global $xml; 70 | $SID=Fritzbox_login(); 71 | $fritzbox_address = $xml->fritzbox->address; 72 | 73 | $URL = "http://".$fritzbox_address."/webservices/homeautoswitch.lua?switchcmd=".urlencode('getdevicelistinfos')."&sid=".urlencode($SID); 74 | $ret = file_get_contents($URL); 75 | if (trim($ret) == "inval" || $ret === FALSE || $ret == "") $ret = "-1"; 76 | return trim($ret); 77 | } 78 | 79 | function Fritzbox_GetHAactorDataFromXML($XML,$ain,$mode) 80 | { 81 | $FBdectVal=-1000; 82 | if ($XML == -1) return $FBdectVal; 83 | 84 | $FBdevices = new SimpleXMLElement($XML); 85 | if ($mode == "id") { 86 | foreach ($FBdevices->device as $devices) { 87 | if (str_replace(" ", "", $devices['identifier'][0]) == $ain) { 88 | $FBdectVal=(int)$devices['id'][0]; 89 | } 90 | } 91 | } elseif ($mode == "fwversion") { 92 | foreach ($FBdevices->device as $devices) { 93 | if (str_replace(" ", "", $devices['identifier'][0]) == $ain) { 94 | $FBdectVal=$devices['fwversion'][0]; 95 | } 96 | } 97 | } elseif ($mode == "manufacturer") { 98 | foreach ($FBdevices->device as $devices) { 99 | if (str_replace(" ", "", $devices['identifier'][0]) == $ain) { 100 | $FBdectVal=$devices['manufacturer'][0]; 101 | } 102 | } 103 | } elseif ($mode == "productname") { 104 | foreach ($FBdevices->device as $devices) { 105 | if (str_replace(" ", "", $devices['identifier'][0]) == $ain) { 106 | $FBdectVal=$devices['productname'][0]; 107 | } 108 | } 109 | } elseif ($mode == "present") { 110 | foreach ($FBdevices->device as $devices) { 111 | if (str_replace(" ", "", $devices['identifier'][0]) == $ain) { 112 | $FBdectVal=(int)$devices->present[0]; 113 | } 114 | } 115 | } elseif ($mode == "name") { 116 | foreach ($FBdevices->device as $devices) { 117 | if (str_replace(" ", "", $devices['identifier'][0]) == $ain) { 118 | $FBdectVal=$devices->name[0]; 119 | } 120 | } 121 | } elseif ($mode == "state") { 122 | foreach ($FBdevices->device as $devices) { 123 | if (str_replace(" ", "", $devices['identifier'][0]) == $ain) { 124 | $FBdectVal=(int)$devices->switch->state[0]; 125 | } 126 | } 127 | } elseif ($mode == "lock") { 128 | foreach ($FBdevices->device as $devices) { 129 | if (str_replace(" ", "", $devices['identifier'][0]) == $ain) { 130 | $FBdectVal=(int)$devices->switch->lock[0]; 131 | } 132 | } 133 | } elseif ($mode == "power") { 134 | foreach ($FBdevices->device as $devices) { 135 | if (str_replace(" ", "", $devices['identifier'][0]) == $ain) { 136 | $FBdectVal=(int)$devices->powermeter->power[0]; 137 | } 138 | } 139 | } elseif ($mode == "energy") { 140 | foreach ($FBdevices->device as $devices) { 141 | if (str_replace(" ", "", $devices['identifier'][0]) == $ain) { 142 | $FBdectVal=(int)$devices->powermeter->energy[0]; 143 | } 144 | } 145 | } elseif ($mode == "temperature") { 146 | foreach ($FBdevices->device as $devices) { 147 | if (str_replace(" ", "", $devices['identifier'][0]) == $ain) { 148 | $FBdectVal=(int)$devices->temperature->celsius[0]; 149 | } 150 | } 151 | } elseif ($mode == "tempoffset") { 152 | foreach ($FBdevices->device as $devices) { 153 | if (str_replace(" ", "", $devices['identifier'][0]) == $ain) { 154 | $FBdectVal=(int)$devices->temperature->offset[0]; 155 | } 156 | } 157 | } 158 | 159 | unset($FBdevices); 160 | return trim($FBdectVal); 161 | } 162 | 163 | function Fritzbox_DECT200_Energie($deviceAIN) { 164 | global $xml; 165 | $SID=Fritzbox_login(); 166 | $fritzbox_address = $xml->fritzbox->address; 167 | $SwitchCMD="getswitchenergy"; 168 | 169 | if($SID <> "Fehler: Login fehlgeschlagen" && $SID != "") { 170 | $Value=Fritzbox_GetSetHAactor($fritzbox_address,$SwitchCMD,$SID,$deviceAIN); 171 | } else { 172 | $Value=$SID; 173 | } 174 | return($Value); 175 | } 176 | 177 | function Fritzbox_DECT200_Power($deviceAIN) { 178 | global $xml; 179 | $SID=Fritzbox_login(); 180 | $fritzbox_address = $xml->fritzbox->address; 181 | $SwitchCMD="getswitchpower"; 182 | 183 | if($SID <> "Fehler: Login fehlgeschlagen" && $SID != "") { 184 | $Value=Fritzbox_GetSetHAactor($fritzbox_address,$SwitchCMD,$SID,$deviceAIN); 185 | } else { 186 | $Value=$SID; 187 | } 188 | return($Value); 189 | } 190 | 191 | function Fritzbox_DECT200_SwitchState($deviceAIN) { 192 | global $xml; 193 | $SID=Fritzbox_login(); 194 | $fritzbox_address = $xml->fritzbox->address; 195 | $SwitchCMD="getswitchstate"; 196 | 197 | if($SID <> "Fehler: Login fehlgeschlagen" && $SID != "") { 198 | $Value=Fritzbox_GetSetHAactor($fritzbox_address,$SwitchCMD,$SID,$deviceAIN); 199 | } else { 200 | $Value=$SID; 201 | } 202 | return($Value); 203 | } 204 | 205 | function Fritzbox_login() { 206 | global $xml; 207 | $FBnet_SIDsource = $xml->backend->sidsource; 208 | 209 | if ($FBnet_SIDsource != "") { 210 | $SID = file_get_contents($FBnet_SIDsource); 211 | return $SID; 212 | } 213 | else { 214 | $fritzbox_address = $xml->fritzbox->address; 215 | $fritzbox_username = $xml->fritzbox->username; 216 | $fritzbox_password = $xml->fritzbox->password; 217 | 218 | $ch = curl_init('http://'.$fritzbox_address.'/login_sid.lua'); 219 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 220 | $login = curl_exec($ch); 221 | $session_status_simplexml = simplexml_load_string($login); 222 | if ($session_status_simplexml->SID != '0000000000000000') { 223 | $SID = $session_status_simplexml->SID; 224 | } else { 225 | $challenge = $session_status_simplexml->Challenge; 226 | $response = $challenge . '-' . md5(mb_convert_encoding($challenge . '-' . $fritzbox_password, "UCS-2LE", "UTF-8")); 227 | curl_setopt($ch, CURLOPT_POSTFIELDS, "response={$response}&page=/login_sid.lua&username={$fritzbox_username}"); 228 | $sendlogin = curl_exec($ch); 229 | $session_status_simplexml = simplexml_load_string($sendlogin); 230 | 231 | if ($session_status_simplexml->SID != '0000000000000000') { 232 | $SID = $session_status_simplexml->SID; 233 | } else { 234 | $SID= "Fehler: Login fehlgeschlagen"; 235 | } 236 | } 237 | curl_close($ch); 238 | return $SID; 239 | } 240 | } 241 | 242 | function Fritzbox_GetSetHAactor($host,$cmd,$sid,$ain) 243 | { 244 | $URL = "http://".$host."/webservices/homeautoswitch.lua?switchcmd=".urlencode($cmd)."&sid=".urlencode($sid); 245 | if ($ain != "") $URL .= "&ain=".urlencode($ain); 246 | $ret = file_get_contents($URL); 247 | if (trim($ret) == "inval") $ret = "-1"; 248 | return trim($ret); 249 | } 250 | ?> -------------------------------------------------------------------------------- /redalert_thread.php: -------------------------------------------------------------------------------- 1 | message; 28 | } 29 | exit(4); 30 | } 31 | 32 | // Abbrechen wenn AlertState NICHT red ist 33 | if ($xml->global->AlertState != "red") exit(); 34 | 35 | // Bridge aus Config anhand der ID ermitteln 36 | $MiLightBridge = $xml->xpath("//milightwifis/milightwifi/id[text()='".$bid."']/parent::*"); 37 | $MiLightBridge = $MiLightBridge[0]; 38 | 39 | // IP der Bridge ermitteln 40 | $milightIP = trim((string)$MiLightBridge->address); 41 | if(!filter_var($milightIP, FILTER_VALIDATE_IP)) { 42 | $milightIPCheck = @gethostbyname(trim((string)$MiLightBridge->address)); 43 | if($milightIP == $milightIPCheck) { 44 | //$msg="MiLight-Bridge ".$milightIP." is not availible. Check IP or Hostname. \n"; 45 | //echo $msg; 46 | return; 47 | } else { 48 | $milightIP = $milightIPCheck; 49 | } 50 | } 51 | 52 | // Connect zur Bridge und alle Lampen der Bridge auf ROT:DUNKEL setzen 53 | $milight = new Milight($milightIP,(integer)$MiLightBridge->port); 54 | $milight->setRgbwActiveGroup(0); 55 | $milight->rgbwSetColorHexString("#FF0000"); 56 | $milight->rgbwBrightnessPercent(40,0); 57 | sleep(1); 58 | 59 | // Zwischen hell und dunkel wechseln solange AlertState RED ist 60 | do { 61 | set_time_limit(30); 62 | //config.xml einlesen 63 | unset($xml); 64 | libxml_use_internal_errors(true); 65 | $xml = simplexml_load_file($CONFIG_FILENAME); 66 | if (!$xml) { 67 | //echo "Kann die Konfiguration (".$CONFIG_FILENAME.") nicht laden!\n"; 68 | foreach(libxml_get_errors() as $error) { 69 | //echo "\t", $error->message; 70 | } 71 | exit(4); 72 | } 73 | 74 | $milight->setRgbwActiveGroup(0); 75 | $milight->rgbwBrightnessPercent(100,0); 76 | sleep(1); 77 | 78 | $milight->setRgbwActiveGroup(0); 79 | $milight->rgbwBrightnessPercent(40,0); 80 | sleep(2.5); 81 | } while ($xml->global->AlertState == "red"); 82 | unset($milight); 83 | 84 | 85 | function switch_milight($device, $action) { 86 | global $xml; 87 | 88 | if($device->address->masterdip == "") { 89 | //echo "ERROR: masterdip (MiLight WiFi-Bridge-ID) ist ungültig für device id ".$device->id."\n"; 90 | return; 91 | } 92 | if($device->address->slavedip == "") { 93 | //echo "ERROR: slavedip (Gruppe auf MiLight WiFi-Bridge) ist ungültig für device id ".$device->id."\n"; 94 | return; 95 | } 96 | if($device->address->tx433version == "") { 97 | //echo "ERROR: tx433version (MiLight Lampentyp) ist ungültig für device id ".$device->id."\n"; 98 | return; 99 | } 100 | if($device->address->slavedip < 0 || $device->address->slavedip > 4) { 101 | //echo "ERROR: slavedip (Gruppe auf MiLight WiFi-Bridge) muss zwischen 0-4 liegen für device id ".$device->id."\n"; 102 | return; 103 | } 104 | if($device->address->tx433version < 1 || $device->address->tx433version > 2) { 105 | //echo "ERROR: tx433version (MiLight Lampentyp) muss zwischen 1-2 liegen für device id ".$device->id."\n"; 106 | return; 107 | } 108 | 109 | $MiLightBridge = $xml->xpath("//milightwifis/milightwifi/id[text()='".$device->address->masterdip."']/parent::*"); 110 | $MiLightBridge = $MiLightBridge[0]; 111 | 112 | $milightIP = trim((string)$MiLightBridge->address); 113 | if(!filter_var($milightIP, FILTER_VALIDATE_IP)) { 114 | $milightIPCheck = @gethostbyname(trim((string)$MiLightBridge->address)); 115 | if($milightIP == $milightIPCheck) { 116 | $msg="MiLight-Bridge ".$milightIP." is not availible. Check IP or Hostname. \n"; 117 | //echo $msg; 118 | return; 119 | } else { 120 | $milightIP = $milightIPCheck; 121 | } 122 | } 123 | 124 | $BulbType="";$BulbCmd=""; 125 | if ($device->address->tx433version == "1") $BulbType="WHITE"; 126 | elseif ($device->address->tx433version == "2") $BulbType="RGBW"; 127 | 128 | $milight = new Milight($milightIP,(integer)$MiLightBridge->port); 129 | 130 | if($action == "ON") { 131 | switch($BulbType){ 132 | case "WHITE": 133 | $milight->whiteSendOnToGroup((integer)$device->address->slavedip); 134 | break; 135 | case "RGBW": 136 | if ($device->milight->mode != "Farbe" && $device->milight->mode != "Weiß" && $device->milight->mode != "Nacht") { 137 | $milight->rgbwSendOnToGroup((integer)$device->address->slavedip); 138 | } 139 | break; 140 | } 141 | } 142 | elseif($action == "OFF") { 143 | switch($BulbType){ 144 | case "WHITE": 145 | $milight->whiteSendOffToGroup((integer)$device->address->slavedip); 146 | break; 147 | case "RGBW": 148 | $milight->rgbwSendOffToGroup((integer)$device->address->slavedip); 149 | break; 150 | } 151 | } 152 | unset($milight); 153 | 154 | //echo $device->name . " wurde geschaltet: ".$action."\n"; 155 | return($action); 156 | } 157 | 158 | function toggle_milight($id, $cmd, $value) { 159 | global $xml; 160 | $DryMode = false; 161 | 162 | $device = $xml->xpath("//devices/device/id[text()='".$id."']/parent::*"); 163 | $device = $device[0]; 164 | 165 | if($device->address->masterdip == "") { 166 | //echo "ERROR: masterdip (MiLight WiFi-Bridge-ID) ist ungültig für device id ".$device->id."\n"; 167 | return; 168 | } 169 | if($device->address->slavedip == "") { 170 | //echo "ERROR: slavedip (Gruppe auf MiLight WiFi-Bridge) ist ungültig für device id ".$device->id."\n"; 171 | return; 172 | } 173 | if($device->address->tx433version == "") { 174 | //echo "ERROR: tx433version (MiLight Lampentyp) ist ungültig für device id ".$device->id."\n"; 175 | return; 176 | } 177 | if($device->address->slavedip < 0 || $device->address->slavedip > 4) { 178 | //echo "ERROR: slavedip (Gruppe auf MiLight WiFi-Bridge) muss zwischen 0-4 liegen für device id ".$device->id."\n"; 179 | return; 180 | } 181 | if($device->address->tx433version < 1 || $device->address->tx433version > 2) { 182 | //echo "ERROR: tx433version (MiLight Lampentyp) muss zwischen 1-2 liegen für device id ".$device->id."\n"; 183 | return; 184 | } 185 | 186 | $MiLightBridge = $xml->xpath("//milightwifis/milightwifi/id[text()='".$device->address->masterdip."']/parent::*"); 187 | $MiLightBridge = $MiLightBridge[0]; 188 | 189 | $milightIP = trim((string)$MiLightBridge->address); 190 | if(!filter_var($milightIP, FILTER_VALIDATE_IP)) { 191 | $milightIPCheck = @gethostbyname(trim((string)$MiLightBridge->address)); 192 | if($milightIP == $milightIPCheck) { 193 | $msg="MiLight-Bridge ".$milightIP." is not availible. Check IP or Hostname. \n"; 194 | //echo $msg; 195 | return; 196 | } else { 197 | $milightIP = $milightIPCheck; 198 | } 199 | } 200 | 201 | $BulbType=""; 202 | if ($device->address->tx433version == "1") $BulbType="WHITE"; 203 | elseif ($device->address->tx433version == "2") $BulbType="RGBW"; 204 | 205 | $milight = new Milight($milightIP,(integer)$MiLightBridge->port); 206 | 207 | switch($BulbType){ 208 | case "WHITE": 209 | // NOCH NICHT IMPLEMENTIERT 210 | break; 211 | case "RGBW": 212 | if (!$DryMode) { 213 | $milight->setRgbwActiveGroup((integer)$device->address->slavedip); 214 | 215 | if ($cmd == "SetColor") { 216 | $milight->rgbwSetColorHexString(trim($value)); 217 | $milight->rgbwBrightnessPercent((integer)$device->milight->brightnesscolor,(integer)$device->address->slavedip); 218 | } 219 | elseif ($cmd == "SetBrightness") { 220 | $milight->rgbwBrightnessPercent((integer)$value,(integer)$device->address->slavedip); 221 | } 222 | elseif ($cmd == "SetToWhite") { 223 | $milight->rgbwSetGroupToWhite((integer)$device->address->slavedip); 224 | $milight->rgbwBrightnessPercent((integer)$device->milight->brightnesswhite,(integer)$device->address->slavedip); 225 | } 226 | elseif ($cmd == "SetToNightMode") { 227 | $milight->rgbwSendOffToGroup((integer)$device->address->slavedip); 228 | $milight->command("rgbwGroup".(integer)$device->address->slavedip."NightMode"); 229 | } 230 | elseif ($cmd == "rgbwDiscoMode" || $cmd == "rgbwDiscoSlower" || $cmd == "rgbwDiscoFaster") { 231 | if ($cmd == "rgbwDiscoMode" || $device->milight->mode == "Programm") { 232 | $milight->rgbwSendOnToActiveGroup(); 233 | $milight->command(trim($cmd)); 234 | 235 | if ($cmd == "rgbwDiscoMode") { 236 | sleep(1); 237 | $milight->setRgbwActiveGroup((integer)$device->address->slavedip); 238 | $milight->rgbwBrightnessPercent((integer)$device->milight->brightnessdisco,(integer)$device->address->slavedip); 239 | } 240 | } 241 | } 242 | } 243 | break; 244 | } 245 | unset($milight); 246 | 247 | //echo $device->name . " wurde geschaltet: ".$action." "; 248 | if (!$DryMode) return("#OK#"); 249 | else return("#".$id."#".$cmd."#".$value."#"); 250 | } 251 | 252 | sleep(0.25); 253 | foreach($xml->devices->device as $device) { 254 | if ($device->vendor == "milight" && (integer)$device->address->masterdip == (integer)$bid) { 255 | if ($device->status == "OFF") switch_milight($device,"OFF"); 256 | elseif ($device->status == "ON") { 257 | switch_milight($device,"ON"); 258 | sleep(0.2); 259 | if ($device->milight->mode == "Weiß") { 260 | $MR = toggle_milight($device->id,"SetToWhite",''); 261 | } elseif ($device->milight->mode == "Farbe") { 262 | $MR = toggle_milight($device->id,"SetColor",$device->milight->color); 263 | } elseif ($device->milight->mode == "Nacht") { 264 | $MR = toggle_milight($device->id,"SetToNightMode",''); 265 | } elseif ($device->milight->mode == "Programm") { 266 | switch_milight($device,"OFF"); 267 | } 268 | } 269 | 270 | sleep(0.25); 271 | } 272 | } 273 | ?> -------------------------------------------------------------------------------- /css/fbswitch.css: -------------------------------------------------------------------------------- 1 | #ms{ 2 | position: fixed; 3 | left:-5%; 4 | top: 200px; 5 | -moz-transform:rotate(-90deg); /* Firefox 3.6 Firefox 4 */ 6 | -webkit-transform:rotate(-90deg); /* Safari */ 7 | -o-transform:rotate(-90deg); /* Opera */ 8 | -ms-transform:rotate(-90deg); /* IE9 */ 9 | transform:rotate(-90deg); /* W3C */ 10 | } 11 | /* icon größe von der liste */ 12 | .ui-li-thumb, .ui-li-icon { 13 | left: 1px; 14 | max-height: 32px; 15 | max-width: 32px; 16 | position: absolute; 17 | top: 0; 18 | } 19 | 20 | .ui-icon-on { 21 | background-image: url("app-icon-on.png"); 22 | } 23 | .ui-icon-off { 24 | background-image: url("app-icon-off.png"); 25 | } 26 | 27 | .hide { 28 | visibility:hidden; 29 | display:none; 30 | } 31 | .show { 32 | visibility:visible; 33 | display:inline; 34 | } 35 | 36 | @media (min-width:35em) { 37 | 38 | /* wrap on wide viewports once open */ 39 | 40 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-push.ui-panel-content-fixed-toolbar-position-left, 41 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-reveal.ui-panel-content-fixed-toolbar-position-left, 42 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-wrap-display-push.ui-panel-content-wrap-position-left, 43 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-wrap-display-reveal.ui-panel-content-wrap-position-left { 44 | margin-right: 17em; 45 | } 46 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-push.ui-panel-content-fixed-toolbar-position-right, 47 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-reveal.ui-panel-content-fixed-toolbar-position-right, 48 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-wrap-display-push.ui-panel-content-wrap-position-right, 49 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-wrap-display-reveal.ui-panel-content-wrap-position-right { 50 | margin-left: 17em; 51 | } 52 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-push, 53 | .ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-reveal { 54 | width: auto; 55 | } 56 | 57 | /* disable "dismiss" on wide viewports */ 58 | .ui-responsive-panel .ui-panel-dismiss-display-push { 59 | display: none; 60 | } 61 | 62 | } 63 | 64 | .box-btn-switch .ui-btn, .box-btn-edit .ui-btn { 65 | height: 45px; 66 | min-width: 55px; 67 | max-width: 116px; 68 | margin: 0 auto; 69 | } 70 | .box-btn-edit .ui-btn-icon-notext .ui-btn-inner .ui-icon { 71 | position: absolute; 72 | left: 16px; 73 | right: 16px; 74 | top: 7px; 75 | } 76 | 77 | .box-btn-switch .ui-btn-corner-all, .box-btn-edit .ui-btn-corner-all, [data-role="header"] .ui-btn-corner-all, [data-role="panel"] .ui-btn-corner-all { 78 | -moz-border-radius: .5em; 79 | -webkit-border-radius: .5em; 80 | border-radius: .5em; 81 | }? 82 | .box-btn-hide { 83 | visibility:hidden; 84 | display:none; 85 | } 86 | .box-btn-show { 87 | visibility:visible; 88 | display:inline; 89 | } 90 | 91 | .box-btn-switch { 92 | /*display: block; 93 | white-space: nowrap;*/ 94 | } 95 | .box-btn-edit { 96 | /*display: none; 97 | white-space: nowrap;*/ 98 | } 99 | 100 | /* 101 | Zeilenumbruch in der Listview 102 | */ 103 | .ui-page .ui-content .ui-listview .ui-li-heading { 104 | white-space: normal; 105 | } 106 | .ui-page .ui-content .ui-listview .ui-li-desc { 107 | white-space: normal; 108 | } 109 | 110 | @media (min-width:1100px) { 111 | #menubutton{ 112 | display:none; 113 | } 114 | } 115 | 116 | #favoriteslinks { 117 | color: ffffff; 118 | display: block; 119 | text-decoration: none; 120 | } 121 | 122 | .user{ 123 | position:fixed; 124 | top:78px; 125 | z-index:401; 126 | width: 1100px; 127 | display:block; 128 | } 129 | #countdown { 130 | color: ffffff; 131 | display: block; 132 | text-decoration: none; 133 | } 134 | select{ 135 | // color: #f00; 136 | } 137 | // #minutes{ 138 | // color: #00f; 139 | // } 140 | // #action{ 141 | // color: #00f; 142 | // } 143 | // #device{ 144 | // color: #00f; 145 | // } 146 | 147 | .loading-splash-div { 148 | position: fixed; 149 | left: 0px; 150 | top: 0px; 151 | width: 100%; 152 | height: 100%; 153 | z-index: 8999; 154 | background: center no-repeat #000000; 155 | overflow: hidden; 156 | } 157 | 158 | .loading-splash-container { 159 | position: absolute; 160 | top: 50%; 161 | margin-top: -170px;/* half of #content height*/ 162 | left: 0; 163 | width: 100%; 164 | } 165 | 166 | .loading-splash { 167 | margin-right: auto; 168 | margin-left: auto; 169 | display: block; 170 | width: 250px; 171 | height: 340px; 172 | text-align: center 173 | } 174 | 175 | .ball { 176 | background-color: rgba(0,0,0,0); 177 | border:5px solid rgba(0,183,229,0.9); 178 | opacity:.9; 179 | border-top:5px solid rgba(0,0,0,0); 180 | border-left:5px solid rgba(0,0,0,0); 181 | border-radius:50px; 182 | box-shadow: 0 0 35px #2187e7; 183 | width:50px; 184 | height:50px; 185 | margin:0 auto; 186 | } 187 | 188 | .play-ball { 189 | -moz-animation:spin .8s infinite linear; 190 | -webkit-animation:spin .8s infinite linear; 191 | } 192 | 193 | .ball1 { 194 | background-color: rgba(0,0,0,0); 195 | border:5px solid rgba(0,183,229,0.9); 196 | opacity:.9; 197 | border-top:5px solid rgba(0,0,0,0); 198 | border-left:5px solid rgba(0,0,0,0); 199 | border-radius:50px; 200 | box-shadow: 0 0 15px #2187e7; 201 | width:30px; 202 | height:30px; 203 | margin:0 auto; 204 | position:relative; 205 | top:-50px; 206 | } 207 | 208 | .play-ball1 { 209 | -moz-animation:spinoff .8s infinite linear; 210 | -webkit-animation:spinoff .8s infinite linear; 211 | } 212 | 213 | @-moz-keyframes spin { 214 | 0% { -moz-transform:rotate(0deg); } 215 | 100% { -moz-transform:rotate(360deg); } 216 | } 217 | @-moz-keyframes spinoff { 218 | 0% { -moz-transform:rotate(0deg); } 219 | 100% { -moz-transform:rotate(-360deg); } 220 | } 221 | @-webkit-keyframes spin { 222 | 0% { -webkit-transform:rotate(0deg); } 223 | 100% { -webkit-transform:rotate(360deg); } 224 | } 225 | @-webkit-keyframes spinoff { 226 | 0% { -webkit-transform:rotate(0deg); } 227 | 100% { -webkit-transform:rotate(-360deg); } 228 | } 229 | 230 | .circle { 231 | background-color: rgba(0,0,0,0); 232 | border:5px solid rgba(234,224,156,0.9); 233 | opacity:.9; 234 | border-right:5px solid rgba(0,0,0,0); 235 | border-left:5px solid rgba(0,0,0,0); 236 | border-radius:50px; 237 | box-shadow: 0 0 35px #eae09c; 238 | width:50px; 239 | height:50px; 240 | margin:0 auto; 241 | } 242 | 243 | .play-circle { 244 | -moz-animation:spinPulse 1.2s infinite ease-in-out; 245 | -webkit-animation:spinPulse 1.2s infinite linear; 246 | } 247 | 248 | .circle1 { 249 | background-color: rgba(0,0,0,0); 250 | border:5px solid rgba(234,224,156,0.9); 251 | opacity:.9; 252 | border-left:5px solid rgba(0,0,0,0); 253 | border-right:5px solid rgba(0,0,0,0); 254 | border-radius:50px; 255 | box-shadow: 0 0 15px #eae09c; 256 | width:30px; 257 | height:30px; 258 | margin:0 auto; 259 | position:relative; 260 | top:-50px; 261 | } 262 | 263 | .play-circle1 { 264 | -moz-animation:spinoffPulse 1.2s infinite linear; 265 | -webkit-animation:spinoffPulse 1.2s infinite linear; 266 | } 267 | 268 | @-moz-keyframes spinPulse { 269 | 0% { -moz-transform:rotate(160deg); opacity:0; box-shadow:0 0 1px #eae09c;} 270 | 50% { -moz-transform:rotate(145deg); opacity:1; } 271 | 100% { -moz-transform:rotate(-320deg); opacity:0; } 272 | } 273 | @-moz-keyframes spinoffPulse { 274 | 0% { -moz-transform:rotate(0deg); } 275 | 100% { -moz-transform:rotate(360deg); } 276 | } 277 | @-webkit-keyframes spinPulse { 278 | 0% { -webkit-transform:rotate(160deg); opacity:0; box-shadow:0 0 1px #eae09c; } 279 | 50% { -webkit-transform:rotate(145deg); opacity:1;} 280 | 100% { -webkit-transform:rotate(-320deg); opacity:0; } 281 | } 282 | @-webkit-keyframes spinoffPulse { 283 | 0% { -webkit-transform:rotate(0deg); } 284 | 100% { -webkit-transform:rotate(360deg); } 285 | } 286 | 287 | #loader-wrapper { 288 | position: fixed; 289 | top: 0; 290 | left: 0; 291 | width: 100%; 292 | height: 100%; 293 | z-index: 9900; 294 | } 295 | #loader { 296 | display: block; 297 | position: fixed; 298 | left: 0; 299 | top: 0; 300 | width: 100%; 301 | height: 100%; 302 | z-index: 9999; 303 | } 304 | 305 | #loader-wrapper .loader-section { 306 | position: fixed; 307 | top: 0; 308 | width: 51%; 309 | height: 100%; 310 | background: #000000; 311 | z-index: 9900; 312 | } 313 | 314 | #loader-wrapper .loader-section.section-left { 315 | left: 0; 316 | } 317 | 318 | #loader-wrapper .loader-section.section-right { 319 | right: 0; 320 | } 321 | 322 | /* Loaded */ 323 | .loaded #loader-wrapper .loader-section.section-left { 324 | -webkit-transform: translateX(-100%); /* Chrome, Opera 15+, Safari 3.1+ */ 325 | -ms-transform: translateX(-100%); /* IE 9 */ 326 | transform: translateX(-100%); /* Firefox 16+, IE 10+, Opera */ 327 | 328 | -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000); 329 | transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000); 330 | } 331 | 332 | .loaded #loader-wrapper .loader-section.section-right { 333 | -webkit-transform: translateX(100%); /* Chrome, Opera 15+, Safari 3.1+ */ 334 | -ms-transform: translateX(100%); /* IE 9 */ 335 | transform: translateX(100%); /* Firefox 16+, IE 10+, Opera */ 336 | 337 | -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000); 338 | transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000); 339 | } 340 | 341 | .loaded #loader { 342 | opacity: 0; 343 | -webkit-transition: all 0.3s ease-out; 344 | transition: all 0.3s ease-out; 345 | } 346 | .loaded #loader-wrapper { 347 | visibility: hidden; 348 | 349 | -webkit-transform: translateY(-100%); /* Chrome, Opera 15+, Safari 3.1+ */ 350 | -ms-transform: translateY(-100%); /* IE 9 */ 351 | transform: translateY(-100%); /* Firefox 16+, IE 10+, Opera */ 352 | 353 | -webkit-transition: all 0.3s 1s ease-out; 354 | transition: all 0.3s 1s ease-out; 355 | } 356 | 357 | .red-alert { 358 | position: fixed; 359 | top: 0; 360 | left: 0; 361 | width: 100%; 362 | height: 100%; 363 | z-index: 8000; 364 | background-color: rgba(0,0,0,0.8); /*dim the background*/ 365 | } 366 | 367 | .red-alert iframe { 368 | position: absolute; 369 | top: 0; 370 | bottom: 0; 371 | left: 0; 372 | right: 0; 373 | margin: auto; 374 | height: 100%; 375 | width: 100%; 376 | background-color: rgba(0,0,0,1); /*dim the background*/ 377 | border-style:none; 378 | } -------------------------------------------------------------------------------- /redalert.php: -------------------------------------------------------------------------------- 1 | message; 28 | } 29 | exit(4); 30 | } 31 | 32 | // Abbrechen wenn AlertState NICHT red ist 33 | if ($xml->global->AlertState != "red") exit(); 34 | 35 | foreach($xml->milightwifis->milightwifi as $milightwifi) { 36 | if ($milightwifi->UseForAlertMode == "true") { 37 | $MLbridges[] = $milightwifi->address; 38 | $MLports[] = $milightwifi->port; 39 | } 40 | } 41 | 42 | for ($y=0; $y < count($MLbridges); $y++) { 43 | $milight = new Milight($MLbridges[$y],(integer)$MLports[$y]); 44 | $milight->rgbwSendOnToGroup(1); 45 | $milight->setRgbwActiveGroup(1); 46 | $milight->rgbwSetColorHexString("#FF0000"); 47 | $milight->rgbwBrightnessPercent(90,1); 48 | $milight->rgbwSendOnToGroup(2); 49 | $milight->setRgbwActiveGroup(2); 50 | $milight->rgbwSetColorHexString("#FF0000"); 51 | $milight->rgbwBrightnessPercent(90,2); 52 | $milight->rgbwSendOnToGroup(3); 53 | $milight->setRgbwActiveGroup(3); 54 | $milight->rgbwSetColorHexString("#FF0000"); 55 | $milight->rgbwBrightnessPercent(90,3); 56 | $milight->rgbwSendOnToGroup(4); 57 | $milight->setRgbwActiveGroup(4); 58 | $milight->rgbwSetColorHexString("#FF0000"); 59 | $milight->rgbwBrightnessPercent(90,4); 60 | 61 | unset($milight); 62 | } 63 | sleep(0.075); 64 | 65 | //for ($x=0; $x < 30;$x++) { 66 | do { 67 | set_time_limit(30); 68 | //config.xml einlesen 69 | unset($xml); 70 | libxml_use_internal_errors(true); 71 | $xml = simplexml_load_file($CONFIG_FILENAME); 72 | if (!$xml) { 73 | //echo "Kann die Konfiguration (".$CONFIG_FILENAME.") nicht laden!\n"; 74 | foreach(libxml_get_errors() as $error) { 75 | //echo "\t", $error->message; 76 | } 77 | exit(4); 78 | } 79 | 80 | for ($y=0; $y < count($MLbridges); $y++) { 81 | $milight = new Milight($MLbridges[$y],(integer)$MLports[$y]); 82 | $milight->rgbwBrightnessPercent(30,1); 83 | $milight->rgbwBrightnessPercent(30,2); 84 | $milight->rgbwBrightnessPercent(30,3); 85 | $milight->rgbwBrightnessPercent(30,4); 86 | unset($milight); 87 | } 88 | sleep(0.2); 89 | for ($y=0; $y < count($MLbridges); $y++) { 90 | $milight = new Milight($MLbridges[$y],(integer)$MLports[$y]); 91 | $milight->rgbwBrightnessPercent(90,1); 92 | $milight->rgbwBrightnessPercent(90,2); 93 | $milight->rgbwBrightnessPercent(90,3); 94 | $milight->rgbwBrightnessPercent(90,4); 95 | unset($milight); 96 | } 97 | sleep(0.075); 98 | 99 | //$ret=file_put_contents("alert.log", "ALERT\n", FILE_APPEND); 100 | //sleep(1); 101 | } while ($xml->global->AlertState == "red"); 102 | 103 | 104 | 105 | function switch_milight($device, $action) { 106 | global $xml; 107 | 108 | if($device->address->masterdip == "") { 109 | //echo "ERROR: masterdip (MiLight WiFi-Bridge-ID) ist ungültig für device id ".$device->id."\n"; 110 | return; 111 | } 112 | if($device->address->slavedip == "") { 113 | //echo "ERROR: slavedip (Gruppe auf MiLight WiFi-Bridge) ist ungültig für device id ".$device->id."\n"; 114 | return; 115 | } 116 | if($device->address->tx433version == "") { 117 | //echo "ERROR: tx433version (MiLight Lampentyp) ist ungültig für device id ".$device->id."\n"; 118 | return; 119 | } 120 | if($device->address->slavedip < 0 || $device->address->slavedip > 4) { 121 | //echo "ERROR: slavedip (Gruppe auf MiLight WiFi-Bridge) muss zwischen 0-4 liegen für device id ".$device->id."\n"; 122 | return; 123 | } 124 | if($device->address->tx433version < 1 || $device->address->tx433version > 2) { 125 | //echo "ERROR: tx433version (MiLight Lampentyp) muss zwischen 1-2 liegen für device id ".$device->id."\n"; 126 | return; 127 | } 128 | 129 | $MiLightBridge = $xml->xpath("//milightwifis/milightwifi/id[text()='".$device->address->masterdip."']/parent::*"); 130 | $MiLightBridge = $MiLightBridge[0]; 131 | 132 | $milightIP = trim((string)$MiLightBridge->address); 133 | if(!filter_var($milightIP, FILTER_VALIDATE_IP)) { 134 | $milightIPCheck = @gethostbyname(trim((string)$MiLightBridge->address)); 135 | if($milightIP == $milightIPCheck) { 136 | $msg="MiLight-Bridge ".$milightIP." is not availible. Check IP or Hostname. \n"; 137 | //echo $msg; 138 | return; 139 | } else { 140 | $milightIP = $milightIPCheck; 141 | } 142 | } 143 | 144 | $BulbType="";$BulbCmd=""; 145 | if ($device->address->tx433version == "1") $BulbType="WHITE"; 146 | elseif ($device->address->tx433version == "2") $BulbType="RGBW"; 147 | 148 | $milight = new Milight($milightIP,(integer)$MiLightBridge->port); 149 | 150 | if($action == "ON") { 151 | switch($BulbType){ 152 | case "WHITE": 153 | $milight->whiteSendOnToGroup((integer)$device->address->slavedip); 154 | break; 155 | case "RGBW": 156 | if ($device->milight->mode != "Farbe" && $device->milight->mode != "Weiß" && $device->milight->mode != "Nacht") { 157 | $milight->rgbwSendOnToGroup((integer)$device->address->slavedip); 158 | } 159 | break; 160 | } 161 | } 162 | elseif($action == "OFF") { 163 | switch($BulbType){ 164 | case "WHITE": 165 | $milight->whiteSendOffToGroup((integer)$device->address->slavedip); 166 | break; 167 | case "RGBW": 168 | $milight->rgbwSendOffToGroup((integer)$device->address->slavedip); 169 | break; 170 | } 171 | } 172 | unset($milight); 173 | 174 | //echo $device->name . " wurde geschaltet: ".$action."\n"; 175 | return($action); 176 | } 177 | 178 | function toggle_milight($id, $cmd, $value) { 179 | global $xml; 180 | $DryMode = false; 181 | 182 | $device = $xml->xpath("//devices/device/id[text()='".$id."']/parent::*"); 183 | $device = $device[0]; 184 | 185 | if($device->address->masterdip == "") { 186 | //echo "ERROR: masterdip (MiLight WiFi-Bridge-ID) ist ungültig für device id ".$device->id."\n"; 187 | return; 188 | } 189 | if($device->address->slavedip == "") { 190 | //echo "ERROR: slavedip (Gruppe auf MiLight WiFi-Bridge) ist ungültig für device id ".$device->id."\n"; 191 | return; 192 | } 193 | if($device->address->tx433version == "") { 194 | //echo "ERROR: tx433version (MiLight Lampentyp) ist ungültig für device id ".$device->id."\n"; 195 | return; 196 | } 197 | if($device->address->slavedip < 0 || $device->address->slavedip > 4) { 198 | //echo "ERROR: slavedip (Gruppe auf MiLight WiFi-Bridge) muss zwischen 0-4 liegen für device id ".$device->id."\n"; 199 | return; 200 | } 201 | if($device->address->tx433version < 1 || $device->address->tx433version > 2) { 202 | //echo "ERROR: tx433version (MiLight Lampentyp) muss zwischen 1-2 liegen für device id ".$device->id."\n"; 203 | return; 204 | } 205 | 206 | $MiLightBridge = $xml->xpath("//milightwifis/milightwifi/id[text()='".$device->address->masterdip."']/parent::*"); 207 | $MiLightBridge = $MiLightBridge[0]; 208 | 209 | $milightIP = trim((string)$MiLightBridge->address); 210 | if(!filter_var($milightIP, FILTER_VALIDATE_IP)) { 211 | $milightIPCheck = @gethostbyname(trim((string)$MiLightBridge->address)); 212 | if($milightIP == $milightIPCheck) { 213 | $msg="MiLight-Bridge ".$milightIP." is not availible. Check IP or Hostname. \n"; 214 | //echo $msg; 215 | return; 216 | } else { 217 | $milightIP = $milightIPCheck; 218 | } 219 | } 220 | 221 | $BulbType=""; 222 | if ($device->address->tx433version == "1") $BulbType="WHITE"; 223 | elseif ($device->address->tx433version == "2") $BulbType="RGBW"; 224 | 225 | $milight = new Milight($milightIP,(integer)$MiLightBridge->port); 226 | 227 | switch($BulbType){ 228 | case "WHITE": 229 | // NOCH NICHT IMPLEMENTIERT 230 | break; 231 | case "RGBW": 232 | if (!$DryMode) { 233 | $milight->setRgbwActiveGroup((integer)$device->address->slavedip); 234 | 235 | if ($cmd == "SetColor") { 236 | $milight->rgbwSetColorHexString(trim($value)); 237 | $milight->rgbwBrightnessPercent((integer)$device->milight->brightnesscolor,(integer)$device->address->slavedip); 238 | } 239 | elseif ($cmd == "SetBrightness") { 240 | $milight->rgbwBrightnessPercent((integer)$value,(integer)$device->address->slavedip); 241 | } 242 | elseif ($cmd == "SetToWhite") { 243 | $milight->rgbwSetGroupToWhite((integer)$device->address->slavedip); 244 | $milight->rgbwBrightnessPercent((integer)$device->milight->brightnesswhite,(integer)$device->address->slavedip); 245 | } 246 | elseif ($cmd == "SetToNightMode") { 247 | $milight->rgbwSendOffToGroup((integer)$device->address->slavedip); 248 | $milight->command("rgbwGroup".(integer)$device->address->slavedip."NightMode"); 249 | } 250 | elseif ($cmd == "rgbwDiscoMode" || $cmd == "rgbwDiscoSlower" || $cmd == "rgbwDiscoFaster") { 251 | if ($cmd == "rgbwDiscoMode" || $device->milight->mode == "Programm") { 252 | $milight->rgbwSendOnToActiveGroup(); 253 | $milight->command(trim($cmd)); 254 | 255 | if ($cmd == "rgbwDiscoMode") { 256 | sleep(1); 257 | $milight->setRgbwActiveGroup((integer)$device->address->slavedip); 258 | $milight->rgbwBrightnessPercent((integer)$device->milight->brightnessdisco,(integer)$device->address->slavedip); 259 | } 260 | } 261 | } 262 | } 263 | break; 264 | } 265 | unset($milight); 266 | 267 | //echo $device->name . " wurde geschaltet: ".$action." "; 268 | if (!$DryMode) return("#OK#"); 269 | else return("#".$id."#".$cmd."#".$value."#"); 270 | } 271 | 272 | sleep(0.2); 273 | foreach($xml->devices->device as $device) { 274 | if ($device->vendor == "milight" && $device->room != "Garten") { 275 | if ($device->status == "OFF") switch_milight($device,"OFF"); 276 | elseif ($device->status == "ON") { 277 | switch_milight($device,"ON"); 278 | sleep(0.2); 279 | if ($device->milight->mode == "Weiß") { 280 | $MR = toggle_milight($device->id,"SetToWhite",''); 281 | } elseif ($device->milight->mode == "Farbe") { 282 | $MR = toggle_milight($device->id,"SetColor",$device->milight->color); 283 | } elseif ($device->milight->mode == "Nacht") { 284 | $MR = toggle_milight($device->id,"SetToNightMode",''); 285 | } elseif ($device->milight->mode == "Programm") { 286 | switch_milight($device,"OFF"); 287 | } 288 | } 289 | 290 | sleep(0.2); 291 | } 292 | } 293 | ?> -------------------------------------------------------------------------------- /includes/incl_actions.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 | Favoriten 6 | 7 | Geräte 8 | gui->showGroupsBtnInMenu == "true") { ?> Gruppen 9 | gui->showRoomsBtnInMenu == "true") { ?> Räume 10 | gui->showTimerBtnInMenu == "true") { ?> Timer 11 | gui->showActionBtnInMenu == "true") { ?> Aktionen 12 | Einstellungen 13 |
14 | gui->showAllOnOffBtnInMenu == "true") { ?> 15 |
16 |
17 |
18 |
19 |
20 | 21 | Schliessen 22 |
23 |
24 | 25 |
26 | Menu 27 |

Aktionen

28 |
29 | 31 | 32 |
33 |
34 | 35 | 46 | 47 |
48 | 49 |
    50 | 57 |
  • background-color:#B63737;-moz-border-radius:.5em;-webkit-border-radius:.5em;border-radius:.5em;"> 58 |
    59 |
    60 |

    61 |
    62 |
    63 |
  • 64 | 74 | actions->action as $action) { 77 | $actionsFound[] = $action; 78 | } 79 | switch ($xml->gui->sortOrderGroups){ 80 | case "SORT_BY_NAME": 81 | usort($actionsFound, "compareGroupsByName"); 82 | break; 83 | case "SORT_BY_ID": 84 | usort($actionsFound, "compareGroupsByID"); 85 | break; 86 | default: 87 | break; 88 | } 89 | foreach($actionsFound as $action) { 90 | ?> 91 | 92 |
  • 93 |
    94 |
    95 |

    name; ?>

    96 | do as $do) { 98 | $tmpNameAction=""; 99 | switch ($do['type']) { 100 | case "device": 101 | $devicesFound = $xml->xpath("//devices/device/id[text()='".$do['id']."']/parent::*"); 102 | $tmpNameAction = "Gerät: ".$devicesFound[0]->name." (".$devicesFound[0]->room.")"; 103 | break; 104 | case "group": 105 | $groupsFound = $xml->xpath("//groups/group/id[text()='".$do['id']."']/parent::*"); 106 | $tmpNameAction = "Gruppe: ".$groupsFound[0]->name; 107 | break; 108 | case "room": 109 | $tmpNameAction = "Raum: ".$do['id']; 110 | break; 111 | case "wait": 112 | $tmpNameAction = "Warte: ".$do['id']." Sekunden"; 113 | break; 114 | } 115 | echo "

    ".$tmpNameAction." "; 116 | if ($do['action'] == "on") echo "AN"; 117 | if ($do['action'] == "off") echo "AUS"; 118 | if ($do['type'] == "device") { 119 | if ( ($devicesFound[0]->vendor == "milight" || $devicesFound[0]->vendor == "milight_rgbcct") && $do['action'] == "on") { 120 | if ($do['mode'] != "") { 121 | echo " (vA) @ "; 122 | echo $do['mode']; 123 | 124 | if ($do['mode'] == "Farbe") { 125 | if ($do['color'] != "") echo " "; 126 | else echo " milight->color."\">● "; 127 | if ($do['brightness'] != "") echo $do['brightness']."%"; 128 | else echo $devicesFound[0]->milight->brightnesscolor."%"; 129 | 130 | if ($devicesFound[0]->vendor == "milight_rgbcct") { 131 | if ($do['saturation'] != "") echo " (Sat.: ".$do['saturation']."%)"; 132 | else echo " (Sat.: ".$devicesFound[0]->milight->saturation."%)"; 133 | } 134 | } 135 | elseif ($do['mode'] == "Weiß") { 136 | if ($do['brightness'] != "") echo " ● ".$do['brightness']."%"; 137 | else echo " ● ".$devicesFound[0]->milight->brightnesswhite."%"; 138 | 139 | if ($devicesFound[0]->vendor == "milight_rgbcct") { 140 | if ($do['temperature'] != "") echo " (".TemperaturePercentToKelvin($do['temperature'])."K)"; 141 | else echo " (".TemperaturePercentToKelvin($devicesFound[0]->milight->temperature)."K)"; 142 | } 143 | } 144 | } 145 | 146 | elseif ($do['mode'] == "") { 147 | echo " @ "; 148 | echo $devicesFound[0]->milight->mode; 149 | 150 | if ($devicesFound[0]->milight->mode == "Farbe") { 151 | echo " milight->color."\">● "; 152 | echo $devicesFound[0]->milight->brightnesscolor."%"; 153 | 154 | if ($devicesFound[0]->vendor == "milight_rgbcct") { 155 | echo " (Sat.: ".$devicesFound[0]->milight->saturation."%)"; 156 | } 157 | } 158 | elseif ($devicesFound[0]->milight->mode == "Weiß") { 159 | echo " ● ".$devicesFound[0]->milight->brightnesswhite."%"; 160 | 161 | if ($devicesFound[0]->vendor == "milight_rgbcct") { 162 | echo " (".TemperaturePercentToKelvin($devicesFound[0]->milight->temperature)."K)"; 163 | } 164 | } 165 | } 166 | } 167 | } 168 | echo "

    "; 169 | } 170 | ?> 171 |
    172 |
    173 |
    174 | 175 |
    176 |
    177 | 178 | 179 |
    180 |
    181 |
    182 |
  • 183 | 184 | 187 | 188 |
189 |
190 |
191 | --------------------------------------------------------------------------------