Code by Scott שאול בן ישוע
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sha'ul ben Yeshua
hubitat-weewx-driver
Commits
646a6696
Verified
Commit
646a6696
authored
Aug 19, 2019
by
Sha'ul ben Yeshua
🎗
Browse files
fixede utf8 encoding
parent
ded24ece
Changes
1
Hide whitespace changes
Inline
Side-by-side
Driver/weeWX-driver.groovy
View file @
646a6696
...
...
@@ -60,7 +60,7 @@ metadata {
attribute
"WeewxUptime"
,
"string"
attribute
"WeewxLocation"
,
"string"
attribute
"Refresh-Weewx"
,
"string"
attribute
"WeatherDisplay"
,
"string"
attribute
"WeatherDisplay"
,
"string"
// Units
attribute
"distanceUnit"
,
"string"
...
...
@@ -105,7 +105,7 @@ metadata {
input
"pressureUnit"
,
"enum"
,
title:
"Pressure Unit"
,
required:
true
,
defaultValue:
"INHg"
,
options:
[
"INHg"
,
"MBAR"
]
input
"rainUnit"
,
"enum"
,
title:
"Rain Unit"
,
required:
true
,
defaultValue:
"IN"
,
options:
[
"IN"
,
"MM"
]
input
"speedUnit"
,
"enum"
,
title:
"Distance & Speed Unit"
,
required:
true
,
defaultValue:
"Miles (MPH)"
,
options:
[
"Miles (MPH)"
,
"Kilometers (KPH)"
]
input
"temperatureUnit"
,
"enum"
,
title:
"Temperature Unit"
,
required:
true
,
defaultValue:
"Fahrenheit (
�
F)"
,
options:
[
"Fahrenheit (
�
F)"
,
"Celsius (
�
C)"
]
input
"temperatureUnit"
,
"enum"
,
title:
"Temperature Unit"
,
required:
true
,
defaultValue:
"Fahrenheit (
°
F)"
,
options:
[
"Fahrenheit (
°
F)"
,
"Celsius (
°
C)"
]
input
"decimalUnit"
,
"enum"
,
title:
"Max Decimal Places"
,
required:
true
,
defaultValue:
"2"
,
options:
[
"1"
,
"2"
,
"3"
,
"4"
,
"5"
]
}
...
...
@@ -181,7 +181,7 @@ def updated() {
units
()
PollStation
()
def
pollIntervalCmd
=
(
settings
?.
pollInterval
?:
"3 Hours"
).
replace
(
" "
,
""
)
if
(
pollInterval
==
"Manual Poll Only"
){
LOGINFO
(
"MANUAL POLLING ONLY"
)}
if
(
pollInterval
==
"Manual Poll Only"
){
/*
LOGINFO( "MANUAL POLLING ONLY")
*/
}
else
{
"runEvery${pollIntervalCmd}"
(
pollSchedule
)}
}
...
...
@@ -297,12 +297,12 @@ def PollStation()
if
(
dewpointRaw1
.
contains
(
"F"
))
{
dewpointRaw1
=
dewpointRaw1
.
replace
(
fcode
,
""
)
if
(
temperatureUnit
==
"Fahrenheit (
�
F)"
){
if
(
temperatureUnit
==
"Fahrenheit (
°
F)"
){
state
.
TU
=
'°F'
state
.
Dewpoint
=
dewpointRaw1
LOGINFO
(
"Dewpoint Input = F - Output = F -- No conversion required"
)
}
if
(
temperatureUnit
==
"Celsius (
�
C)"
){
if
(
temperatureUnit
==
"Celsius (
°
C)"
){
state
.
TU
=
'°C'
def
dewpoint1
=
convertFtoC
(
dewpointRaw1
)
state
.
Dewpoint
=
dewpoint1
...
...
@@ -313,12 +313,12 @@ def PollStation()
if
(
dewpointRaw1
.
contains
(
"C"
))
{
dewpointRaw1
=
dewpointRaw1
.
replace
(
ccode
,
""
)
if
(
temperatureUnit
==
"Fahrenheit (
�
F)"
){
if
(
temperatureUnit
==
"Fahrenheit (
°
F)"
){
state
.
TU
=
'°F'
def
dewpoint1
=
convertCtoF
(
dewpointRaw1
)
state
.
Dewpoint
=
dewpoint1
}
if
(
temperatureUnit
==
"Celsius (
�
C)"
){
if
(
temperatureUnit
==
"Celsius (
°
C)"
){
state
.
TU
=
'°C'
state
.
Dewpoint
=
dewpointRaw1
LOGINFO
(
"Dewpoint Input = C - Output = C -- No conversion required"
)
...
...
@@ -453,13 +453,13 @@ def PollStation()
if
(
insideTemperatureRaw1
.
contains
(
"F"
))
{
insideTemperatureRaw1
=
insideTemperatureRaw1
.
replace
(
fcode
,
""
)
if
(
temperatureUnit
==
"Fahrenheit (
�
F)"
){
if
(
temperatureUnit
==
"Fahrenheit (
°
F)"
){
state
.
TU
=
'°F'
state
.
InsideTemp
=
insideTemperatureRaw1
LOGINFO
(
"InsideTemperature Input = F - Output = F -- No conversion required"
)
}
if
(
temperatureUnit
==
"Celsius (
�
C)"
){
if
(
temperatureUnit
==
"Celsius (
°
C)"
){
state
.
TU
=
'°C'
def
insideTemp1
=
convertFtoC
(
insideTemperatureRaw1
)
state
.
InsideTemp
=
insideTemp1
...
...
@@ -471,12 +471,12 @@ def PollStation()
if
(
insideTemperatureRaw1
.
contains
(
"C"
))
{
insideTemperatureRaw1
=
insideTemperatureRaw1
.
replace
(
ccode
,
""
)
if
(
temperatureUnit
==
"Fahrenheit (
�
F)"
){
if
(
temperatureUnit
==
"Fahrenheit (
°
F)"
){
state
.
TU
=
'°F'
def
insideTemp1
=
convertCtoF
(
insideTemperatureRaw1
)
state
.
InsideTemp
=
insideTemp1
}
if
(
temperatureUnit
==
"Celsius (
�
C)"
){
if
(
temperatureUnit
==
"Celsius (
°
C)"
){
state
.
TU
=
'°C'
state
.
InsideTemp
=
insideTemperatureRaw1
LOGINFO
(
"InsideTemperature Input = C - Output = C --No conversion required"
)
...
...
@@ -572,13 +572,13 @@ def PollStation()
if
(
temperatureRaw1
.
contains
(
"F"
))
{
temperatureRaw1
=
temperatureRaw1
.
replace
(
fcode
,
""
)
if
(
temperatureUnit
==
"Fahrenheit (
�
F)"
){
if
(
temperatureUnit
==
"Fahrenheit (
°
F)"
){
state
.
TU
=
'°F'
state
.
Temperature
=
temperatureRaw1
LOGINFO
(
"Temperature Input = F - Output = F -- No conversion required"
)
}
if
(
temperatureUnit
==
"Celsius (
�
C)"
){
if
(
temperatureUnit
==
"Celsius (
°
C)"
){
state
.
TU
=
'°C'
def
temp1
=
convertFtoC
(
temperatureRaw1
)
state
.
Temperature
=
temp1
...
...
@@ -590,12 +590,12 @@ def PollStation()
if
(
temperatureRaw1
.
contains
(
"C"
))
{
temperatureRaw1
=
temperatureRaw1
.
replace
(
ccode
,
""
)
if
(
temperatureUnit
==
"Fahrenheit (
�
F)"
){
if
(
temperatureUnit
==
"Fahrenheit (
°
F)"
){
state
.
TU
=
'°F'
def
temp1
=
convertCtoF
(
temperatureRaw1
)
state
.
Temperature
=
temp1
}
if
(
temperatureUnit
==
"Celsius (
�
C)"
){
if
(
temperatureUnit
==
"Celsius (
°
C)"
){
state
.
TU
=
'°C'
state
.
Temperature
=
temperatureRaw1
LOGINFO
(
"Temperature Input = C - Output = C --No conversion required"
)
...
...
@@ -614,13 +614,13 @@ def PollStation()
if
(
tempMinRaw1
.
contains
(
"F"
))
{
tempMinRaw1
=
tempMinRaw1
.
replace
(
fcode
,
""
)
if
(
temperatureUnit
==
"Fahrenheit (
�
F)"
){
if
(
temperatureUnit
==
"Fahrenheit (
°
F)"
){
state
.
TU
=
'°F'
state
.
MinTemperature
=
tempMinRaw1
LOGINFO
(
"Min Temperature Input = F - Output = F -- No conversion required"
)
}
if
(
temperatureUnit
==
"Celsius (
�
C)"
){
if
(
temperatureUnit
==
"Celsius (
°
C)"
){
state
.
TU
=
'°C'
def
tempMin
=
convertFtoC
(
tempMinRaw1
)
state
.
MinTemperature
=
tempMin
...
...
@@ -632,12 +632,12 @@ def PollStation()
if
(
tempMinRaw1
.
contains
(
"C"
))
{
tempMinRaw1
=
tempMinRaw1
.
replace
(
ccode
,
""
)
if
(
temperatureUnit
==
"Fahrenheit (
�
F)"
){
if
(
temperatureUnit
==
"Fahrenheit (
°
F)"
){
state
.
TU
=
'°F'
def
tempMin
=
convertCtoF
(
tempMinRaw1
)
state
.
MinTemperature
=
tempMin
}
if
(
temperatureUnit
==
"Celsius (
�
C)"
){
if
(
temperatureUnit
==
"Celsius (
°
C)"
){
state
.
TU
=
'°C'
state
.
MinTemperature
=
tempMinRaw1
LOGINFO
(
"Min Temperature Input = C - Output = C --No conversion required"
)
...
...
@@ -656,13 +656,13 @@ def PollStation()
if
(
tempMaxRaw1
.
contains
(
"F"
))
{
tempMaxRaw1
=
tempMaxRaw1
.
replace
(
fcode
,
""
)
if
(
temperatureUnit
==
"Fahrenheit (
�
F)"
){
if
(
temperatureUnit
==
"Fahrenheit (
°
F)"
){
state
.
TU
=
'°F'
state
.
MaxTemperature
=
tempMaxRaw1
LOGINFO
(
"Max Temperature Input = F - Output = F -- No conversion required"
)
}
if
(
temperatureUnit
==
"Celsius (
�
C)"
){
if
(
temperatureUnit
==
"Celsius (
°
C)"
){
state
.
TU
=
'°C'
def
tempMax
=
convertFtoC
(
tempMaxRaw1
)
state
.
MaxTemperature
=
tempMax
...
...
@@ -674,12 +674,12 @@ def PollStation()
if
(
tempMaxRaw1
.
contains
(
"C"
))
{
tempMaxRaw1
=
tempMaxRaw1
.
replace
(
ccode
,
""
)
if
(
temperatureUnit
==
"Fahrenheit (
�
F)"
){
if
(
temperatureUnit
==
"Fahrenheit (
°
F)"
){
state
.
TU
=
'°F'
def
tempMax
=
convertCtoF
(
tempMaxRaw1
)
state
.
MaxTemperature
=
tempMax
}
if
(
temperatureUnit
==
"Celsius (
�
C)"
){
if
(
temperatureUnit
==
"Celsius (
°
C)"
){
state
.
TU
=
'°C'
state
.
MaxTemperature
=
tempMaxRaw1
LOGINFO
(
"Max Temperature Input = C - Output = C --No conversion required"
)
...
...
@@ -697,13 +697,13 @@ def PollStation()
if
(
tempMinInRaw1
.
contains
(
"F"
))
{
tempMinInRaw1
=
tempMinInRaw1
.
replace
(
fcode
,
""
)
if
(
temperatureUnit
==
"Fahrenheit (
�
F)"
){
if
(
temperatureUnit
==
"Fahrenheit (
°
F)"
){
state
.
TU
=
'°F'
state
.
MinInsideTemperature
=
tempMinInRaw1
LOGINFO
(
"Min Temperature Input = F - Output = F -- No conversion required"
)
}
if
(
temperatureUnit
==
"Celsius (
�
C)"
){
if
(
temperatureUnit
==
"Celsius (
°
C)"
){
state
.
TU
=
'°C'
def
tempMinIn
=
convertFtoC
(
tempMinInRaw1
)
state
.
MinInsideTemperature
=
tempMinIn
...
...
@@ -715,12 +715,12 @@ def PollStation()
if
(
tempMinInRaw1
.
contains
(
"C"
))
{
tempMinInRaw1
=
tempMinInRaw1
.
replace
(
ccode
,
""
)
if
(
temperatureUnit
==
"Fahrenheit (
�
F)"
){
if
(
temperatureUnit
==
"Fahrenheit (
°
F)"
){
state
.
TU
=
'°F'
def
tempMinIn
=
convertCtoF
(
tempMinInRaw1
)
state
.
MinInsideTemperature
=
tempMinIn
}
if
(
temperatureUnit
==
"Celsius (
�
C)"
){
if
(
temperatureUnit
==
"Celsius (
°
C)"
){
state
.
TU
=
'°C'
state
.
MinInsideTemperature
=
tempMinInRaw1
LOGINFO
(
"Min Temperature Input = C - Output = C --No conversion required"
)
...
...
@@ -739,13 +739,13 @@ def PollStation()
if
(
tempMaxInRaw1
.
contains
(
"F"
))
{
tempMaxInRaw1
=
tempMaxInRaw1
.
replace
(
fcode
,
""
)
if
(
temperatureUnit
==
"Fahrenheit (
�
F)"
){
if
(
temperatureUnit
==
"Fahrenheit (
°
F)"
){
state
.
TU
=
'°F'
state
.
MaxInsideTemperature
=
tempMaxInRaw1
LOGINFO
(
"Max Temperature Input = F - Output = F -- No conversion required"
)
}
if
(
temperatureUnit
==
"Celsius (
�
C)"
){
if
(
temperatureUnit
==
"Celsius (
°
C)"
){
state
.
TU
=
'°C'
def
tempMaxIn
=
convertFtoC
(
tempMaxInRaw1
)
state
.
MaxInsideTemperature
=
tempMaxIn
...
...
@@ -757,12 +757,12 @@ def PollStation()
if
(
tempMaxInRaw1
.
contains
(
"C"
))
{
tempMaxInRaw1
=
tempMaxInRaw1
.
replace
(
ccode
,
""
)
if
(
temperatureUnit
==
"Fahrenheit (
�
F)"
){
if
(
temperatureUnit
==
"Fahrenheit (
°
F)"
){
state
.
TU
=
'°F'
def
tempMaxIn
=
convertCtoF
(
tempMaxInRaw1
)
state
.
MaxInsideTemperature
=
tempMaxIn
}
if
(
temperatureUnit
==
"Celsius (
�
C)"
){
if
(
temperatureUnit
==
"Celsius (
°
C)"
){
state
.
TU
=
'°C'
state
.
MaxInsideTemperature
=
tempMaxInRaw1
LOGINFO
(
"Max Temperature Input = C - Output = C --No conversion required"
)
...
...
@@ -821,13 +821,13 @@ def PollStation()
if
(
windChillRaw1
.
contains
(
"F"
))
{
windChillRaw1
=
windChillRaw1
.
replace
(
fcode
,
""
)
if
(
temperatureUnit
==
"Fahrenheit (
�
F)"
){
if
(
temperatureUnit
==
"Fahrenheit (
°
F)"
){
state
.
TU
=
'°F'
state
.
FeelsLike
=
windChillRaw1
LOGINFO
(
"FeelsLike Input = F - Output = F -- No conversion required"
)
}
if
(
temperatureUnit
==
"Celsius (
�
C)"
){
if
(
temperatureUnit
==
"Celsius (
°
C)"
){
state
.
TU
=
'°C'
def
feelslike1
=
convertFtoC
(
windChillRaw1
)
state
.
FeelsLike
=
feelslike1
...
...
@@ -839,12 +839,12 @@ def PollStation()
if
(
windChillRaw1
.
contains
(
"C"
))
{
windChillRaw1
=
windChillRaw1
.
replace
(
ccode
,
""
)
if
(
temperatureUnit
==
"Fahrenheit (
�
F)"
){
if
(
temperatureUnit
==
"Fahrenheit (
°
F)"
){
state
.
TU
=
'°F'
def
feelslike1
=
convertCtoF
(
windChillRaw1
)
state
.
FeelsLike
=
feelslike1
}
if
(
temperatureUnit
==
"Celsius (
�
C)"
){
if
(
temperatureUnit
==
"Celsius (
°
C)"
){
state
.
TU
=
'°C'
state
.
FeelsLike
=
windChillRaw1
LOGINFO
(
"FeelsLike Input = C - Output = C --No conversion required"
)
...
...
@@ -1179,10 +1179,10 @@ def tempColour(){
if
(
tempColour1
==
true
){
state
.
temperature
=
state
.
Temperature
.
toDouble
()
state
.
feelslike
=
state
.
FeelsLike
.
toDouble
()
if
(
temperatureUnit
==
"Fahrenheit (
�
F)"
){
if
(
temperatureUnit
==
"Fahrenheit (
°
F)"
){
}
if
(
temperatureUnit
==
"Celsius (
�
C)"
){
if
(
temperatureUnit
==
"Celsius (
°
C)"
){
if
(
state
.
temperature
<
0
){
state
.
fc
=
046
AF4
}
if
(
state
.
feelslike
<
0
){
state
.
fc
=
046
AF4
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment