0

OpenHAB コントロールを Philips Hue Color 電球にしようとしています。一部のファイルで友人の助けを借りましたが、UI を使用して制御することはできません。に存在するものは次のpi@raspberrypi:/opt/openhab/configurations/sitemaps $ vim iotpi.sitemapとおりです。

sitemap demo label="Main Menu"
{

        Frame label="Lights" {
                Switch         item=Toggle_1                                label="Garage"
                Colorpicker    item=Color_1    visibility=[Toggle_1==ON]    label="Garage Light Color"
                Slider         item=Dimm_1     visibility=[Toggle_1==ON]    label="Garage Brightness"
                Slider         item=CT_Dimm_1  visibility=[Toggle_1==ON]    label="Garage Color Temperature"
        }  
} 

に存在するものは次のpi@raspberrypi:/opt/openhab/configurations/rules $ vim iotpi.rulesとおりです。

import org.openhab.core.library.types.*
import org.openhab.model.script.actions.*
import org.openhab.core.persistence.*



//var DecimalType hue = new DecimalType(240) // 0-360; 0=red, 120=green, 240=blue, 360=red(again)
//var PercentType sat = new PercentType(100) // 0-100
//var PercentType bright = new PercentType(100) // 0-100
//var HSBType light = new HSBType(hue,sat,bright)


rule "Garage Light"
when
    Item Toggle_1 received command
then
    if(receivedCommand==ON) {
        sendCommand(Toggle_1, ON)
        //sendHttpGetRequest("http://<ip_address>/cgi-bin/do?cmd=ir_code&ir_code=A05FBF00")
    } else if(receivedCommand==OFF) {
        // turn off Dune HD and AVR
        //sendHttpGetRequest("http://<ip_address>/cgi-bin/do?cmd=ir_code&ir_code=A15EBF00")
        sendCommand(Toggle_1, OFF)
    }
end

そして、これが my に存在するものpi@raspberrypi:/opt/openhab/configurations/items $ vi iotpi.itemsです:

Switch Toggle_1   "Garage bulb"   (Switching) {hue="3"}
Color Color_1     "Garage bulb"   (Colorize)  {hue="1"}
Dimmer Dimm_1     "Garage bulb"   (WhiteDimmer)   {hue="1;brightness;30"}
Dimmer CT_Dimm_1      "Garage bulb"   (CTDimmer)  {hue="1;colorTemperature;30"}

また、フォルダー内のファイルopenhab.cfgopenhab_default.cfgファイルの両方に次のものがあります。configuration

hue:ip=192.168.1.105
hue:secret=openHABRuntime
hue:refresh=10000

欠落しているパーツと、Raspberry Pi 2 Model B で実行されている OpenHAB UI で色相を制御できない理由がわかりません。

Pi IP を参照すると、中断せずに次のトグルが行われます。中断することなく数秒ごとに変更されるため、誰が UI に ON/OFF コマンドを送信しているかわかりません。 ここに画像の説明を入力

ここに画像の説明を入力

これは、フォルダーに表示されるものevents.logですopenhab log

2016-03-22 23:39:40 - Toggle_1 received command ON
2016-03-22 23:39:40 - Toggle_1 received command ON
2016-03-22 23:39:40 - Toggle_1 received command ON
2016-03-22 23:39:40 - Toggle_1 received command ON
2016-03-22 23:39:40 - Toggle_1 received command ON
2016-03-22 23:39:40 - Toggle_1 received command ON
2016-03-22 23:39:40 - Toggle_1 received command ON
2016-03-22 23:39:40 - Toggle_1 received command ON
2016-03-22 23:39:40 - Toggle_1 received command ON
2016-03-22 23:39:40 - Toggle_1 received command ON
2016-03-22 23:39:41 - Toggle_1 received command ON
2016-03-22 23:39:41 - Toggle_1 received command ON
2016-03-22 23:39:41 - Toggle_1 received command ON
2016-03-22 23:39:41 - Toggle_1 received command ON
2016-03-22 23:39:41 - Toggle_1 received command ON
2016-03-22 23:39:41 - Toggle_1 received command ON
2016-03-22 23:39:41 - Toggle_1 received command ON
2016-03-22 23:39:41 - Toggle_1 received command ON
2016-03-22 23:39:41 - Toggle_1 received command ON
2016-03-22 23:39:41 - Toggle_1 received command OFF
2016-03-22 23:39:41 - Toggle_1 received command ON
2016-03-22 23:39:41 - Toggle_1 received command OFF
2016-03-22 23:39:41 - Toggle_1 received command OFF
2016-03-22 23:39:41 - Toggle_1 received command OFF
2016-03-22 23:39:41 - Toggle_1 received command OFF
2016-03-22 23:39:41 - Toggle_1 received command OFF

そして、ここに別のログファイルからのいくつかの行があります2016_03_22.request.log:

0:0:0:0:0:0:0:1 -  -  [22/Mar/2016:23:40:41 +0000] "GET /openhab.app?sitemap=iotpi&poll=true&__async=true&__source=waHome HTTP/1.1" 200 2310
0:0:0:0:0:0:0:1 -  -  [22/Mar/2016:23:40:42 +0000] "GET /openhab.app?sitemap=iotpi&poll=true&__async=true&__source=waHome HTTP/1.1" 200 1925
0:0:0:0:0:0:0:1 -  -  [22/Mar/2016:23:40:43 +0000] "GET /openhab.app?sitemap=iotpi&poll=true&__async=true&__source=waHome HTTP/1.1" 200 644
0:0:0:0:0:0:0:1 -  -  [22/Mar/2016:23:40:43 +0000] "GET /openhab.app?sitemap=iotpi&poll=true&__async=true&__source=waHome HTTP/1.1" 200 644
0:0:0:0:0:0:0:1 -  -  [22/Mar/2016:23:40:44 +0000] "GET /openhab.app?sitemap=iotpi&poll=true&__async=true&__source=waHome HTTP/1.1" 200 644
0:0:0:0:0:0:0:1 -  -  [22/Mar/2016:23:40:44 +0000] "GET /openhab.app?sitemap=iotpi&poll=true&__async=true&__source=waHome HTTP/1.1" 200 644
0:0:0:0:0:0:0:1 -  -  [22/Mar/2016:23:40:45 +0000] "GET /openhab.app?sitemap=iotpi&poll=true&__async=true&__source=waHome HTTP/1.1" 200 644
0:0:0:0:0:0:0:1 -  -  [22/Mar/2016:23:40:45 +0000] "GET /openhab.app?sitemap=iotpi&poll=true&__async=true&__source=waHome HTTP/1.1" 200 644
0:0:0:0:0:0:0:1 -  -  [22/Mar/2016:23:40:46 +0000] "GET /openhab.app?sitemap=iotpi&poll=true&__async=true&__source=waHome HTTP/1.1" 200 644
0:0:0:0:0:0:0:1 -  -  [22/Mar/2016:23:40:47 +0000] "GET /openhab.app?sitemap=iotpi&poll=true&__async=true&__source=waHome HTTP/1.1" 200 644
0:0:0:0:0:0:0:1 -  -  [22/Mar/2016:23:40:47 +0000] "GET /openhab.app?sitemap=iotpi&poll=true&__async=true&__source=waHome HTTP/1.1" 200 644
0:0:0:0:0:0:0:1 -  -  [22/Mar/2016:23:40:48 +0000] "GET /openhab.app?sitemap=iotpi&poll=true&__async=true&__source=waHome HTTP/1.1" 200 644
0:0:0:0:0:0:0:1 -  -  [22/Mar/2016:23:40:48 +0000] "GET /openhab.app?sitemap=iotpi&poll=true&__async=true&__source=waHome HTTP/1.1" 200 644
0:0:0:0:0:0:0:1 -  -  [22/Mar/2016:23:40:49 +0000] "GET /openhab.app?sitemap=iotpi&poll=true&__async=true&__source=waHome HTTP/1.1" 200 2310

ついに:

pi@raspberrypi:/opt/openhab/logs $ vi openhab.log 

2016-03-22 23:35:07.415 [INFO ] [.o.core.internal.CoreActivator] - openHAB runtime has been started (v1.8.1).
2016-03-22 23:35:14.419 [INFO ] [o.o.i.s.i.DiscoveryServiceImpl] - mDNS service has been started
2016-03-22 23:35:14.606 [INFO ] [o.o.i.s.i.DiscoveryServiceImpl] - Service Discovery initialization completed.
2016-03-22 23:35:21.676 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'demo.script'
2016-03-22 23:35:23.349 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'rrd4j.persist'
2016-03-22 23:35:23.484 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'logging.persist'
2016-03-22 23:35:23.550 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'db4o.persist'
2016-03-22 23:35:23.586 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'exec.persist'
2016-03-22 23:35:23.736 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'iotpi.items'
2016-03-22 23:35:23.872 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'demo.items'
2016-03-22 23:35:34.028 [INFO ] [penhab.io.rest.RESTApplication] - Started REST API at /rest
2016-03-22 23:35:34.783 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'demo.sitemap'
2016-03-22 23:35:35.405 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'iotpi.sitemap'
2016-03-22 23:35:35.459 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'buiten.sitemap'
2016-03-22 23:35:39.918 [INFO ] [.o.u.w.i.servlet.WebAppServlet] - Started Classic UI at /classicui/openhab.app
2016-03-22 23:35:46.003 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'zwave.rules'
2016-03-22 23:35:46.977 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'demo.rules'
2016-03-22 23:36:04.466 [WARN ] [.o.c.p.e.PersistenceExtensions] - There is no queryable persistence service registered with the name 'rrd4j'
2016-03-22 23:36:04.478 [ERROR] [m.r.internal.engine.RuleEngine] - Error during the execution of startup rule 'Update max and min temperatures': cannot invoke method public abstract org.openhab.core.types.State org.openhab.core.persistence.HistoricItem.getState() on null
2016-03-22 23:36:04.494 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'iotpi.rules'
2016-03-22 23:36:04.610 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'hue.rules'
2016-03-22 23:36:04.869 [INFO ] [.service.AbstractActiveService] - NTP Refresh Service has been started
2016-03-22 23:36:05.021 [INFO ] [.service.AbstractActiveService] - HTTP Refresh Service has been started
2016-03-22 23:36:06.127 [INFO ] [.p.rrd4j.internal.RRD4jService] - Removing invalid defintion component = null heartbeat = 0 min/max = 0.0/0.0 step = 0 0 archives(s) = [] 0 items(s) = []
2016-03-22 23:36:12.314 [INFO ] [.service.AbstractActiveService] - Hue Refresh Service has been started
2016-03-22 23:36:13.497 [INFO ] [g.openhab.model.script.Weather] - Temperature evolved of 0 degrees.
~                                                                                                       

この問題で説明されている最新の OpenHAB の私の github へのリンクは次のとおりです: https://github.com/lamiastella/OpenHAB

4

1 に答える 1