And any idea how I could add the barometer trend value?I'm still learning how to find all of the available values in extensions and throughout the system.
Haha. I suspect that 'server uptime' variable is optimistic. :)Maybe this is a more general question than just on this extension.How do I know what weewx values are available to the extension (or any extension for that matter?). For example, what is the "rain" variable actually returning in twitter. It is not the daily rain sum... how can I know what is what and what is available for display?
but the fastest and most accurate way is rather pythonic: just do it! run weewx directly and see what it spits out in each LOOP and REC dictionary.m
On Thursday, December 28, 2017 at 11:58:22 AM UTC-8, mwall wrote:but the fastest and most accurate way is rather pythonic: just do it! run weewx directly and see what it spits out in each LOOP and REC dictionary.
I sense this is the answer I am looking for (Luke lol) but as to how I might accomplish that... my use of the pythonic-force is weak.Help me Obi-MWall-Kenobi you're my only hope.
Whoa. OK, that was awesome.However, if I put in 'dayRain' (or dayrain) as it is delivered within the LOOP or REC packets from weewx within my format command for the twitter extension, it just spits out:Rain Today: {dayRain:%.1f}mmrather than actually parsing the variable.However, other variables, like outTemp or heatindex or windchill seem to match up and work just fine. So I am definitely missing a crucial step here.
Also, any ideas on how to pass a new line within the format option so thatOutputoncan lookmorelike this?
REC: 2017-12-28 12:50:00 PST (1514494200) altimeter: 29.8871528188, appTemp: 32.1224062668, barometer: 29.901, cloudbase: 101.0, consBatteryVoltage: 4.62, dateTime: 1514494200, dayET: 0.0, dayRain: 0.75, dewpoint: 35.2, ET: 0.0, extraAlarm1: 0.0, extraAlarm2: 0.0, extraAlarm3: 0.0, extraAlarm4: 0.0, extraAlarm5: 0.0, extraAlarm6: 0.0, extraAlarm7: 0.0, extraAlarm8: 0.0, forecastIcon: 7.0, forecastRule: 93, heatindex: 35.2, highOutTemp: 35.2, highRadiation: 58.0, highUV: 0.0, humidex: 35.2, inDewpoint: 40.2825325477, inHumidity: 38.0, insideAlarm: 0.0, inTemp: 66.7, interval: 5, leafWet4: 0.0, lowOutTemp: 35.1, maxSolarRad: 200.328662136, monthET: 0.22, monthRain: 3.13, outHumidity: 100.0, outsideAlarm1: 0.0, outsideAlarm2: 0.0, outTemp: 35.2, outTempDay: 35.2, outTempNight: None, pressure: 29.7870205707, radiation: 48.0, rain: 0.0, rainAlarm: 0.0, rainRate: 0.0, rxCheckPercent: 97.375, soilLeafAlarm1: 0.0, soilLeafAlarm2: 0.0, soilLeafAlarm3: 0.0, soilLeafAlarm4: 0.0, stormRain: 0.94, stormStart: 1514188800.0, sunrise: 1514477640.0, sunset: 1514507280.0, trendIcon: -60.0, txBatteryStatus: 0, usUnits: 1, UV: 0.0, windchill: 35.2, windDir: None, windGust: 0.0, windGustDir: None, windrun: 0.000566893424036, windSpeed: 0.0, windSpeed10: 0.0, yearET: 32.26, yearRain: 28.79
LOOP: 2017-12-28 12:50:27 PST (1514494227) altimeter: 29.8871528188, appTemp: 32.1224062668, barometer: 29.901, cloudbase: 101.0, consBatteryVoltage: 4.62, dateTime: 1514494227, dayET: 0.0, dayRain: 0.75, dewpoint: 35.2, extraAlarm1: 0, extraAlarm2: 0, extraAlarm3: 0, extraAlarm4: 0, extraAlarm5: 0, extraAlarm6: 0, extraAlarm7: 0, extraAlarm8: 0, forecastIcon: 7, forecastRule: 93, heatindex: 35.2, humidex: 35.2, inDewpoint: 40.2825325477, inHumidity: 38.0, insideAlarm: 0, inTemp: 66.7, leafWet4: 0.0, maxSolarRad: 200.155823598, monthET: 0.22, monthRain: 3.13, outHumidity: 100.0, outsideAlarm1: 0, outsideAlarm2: 0, outTemp: 35.2, outTempDay: 35.2, outTempNight: None, pressure: 29.7870205707, radiation: 62.0, rain: 0.0, rainAlarm: 0, rainRate: 0.0, soilLeafAlarm1: 0, soilLeafAlarm2: 0, soilLeafAlarm3: 0, soilLeafAlarm4: 0, stormRain: 0.94, stormStart: 1514188800, sunrise: 1514477640, sunset: 1514507280, trendIcon: -60, txBatteryStatus: 0, usUnits: 1, UV: 0.0, windchill: 35.2, windDir: None, windGust: 0.0, windGustDir: None, windSpeed: 0.0, windSpeed10: 0.0, yearET: 32.26, yearRain: 28.79
I used dayrain without success.
On the newline issue. No luck with either of the escape characters, which I had tried before, or the unicode.
I have also tried a few techniques for getting new lines into code listed here:
https://www.smallsurething.com/multi-line-strings-in-python/
Unfortunately, no success.
Chris
I used dayrain without success.
def process_record(self, record, dummy_manager):
if self.unit_system is not None:
record = weewx.units.to_std_system(record, self.unit_system)
record['station'] = self.station
def process_record(self, record, mgr):
record = self.get_record(record, mgr)
if self.unit_system is not None:
record = weewx.units.to_std_system(record, self.unit_system)
record['station'] = self.station
format = "{station} {dateTime:%H:%M %b %d %Y}: T: {outTemp:%.1f}ºC D: {dewpoint:%.1f}ºC W: {windDir:ORD} {windSpeed:%.1f}kph gusting to {windGust:%.1f}kph H: {outHumidity:%.0f}% P: {barometer:%.2f}hPa Rain Rate: {rainRate:%.1f}mm/hr Chill:{windchill:%.1f}ºC HIndex:{heatindex:%.1f}ºC Solar: {radiation:%.0f}W/m2 UV: {UV:%.0f} #PortAlberni https://www.alberniweather.cahttps://www.youtube.com/alberniweather"
--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/YXlx_CAWO5Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
Chris
%0a
Gary
That's a negative on both  and %0a
That twython is capable of sending "new lines" to twitter. And of course python is able to have new lines within strings. Is it perhaps some way in how the .conf file is being parsed that does not allow these characters through properly?
>>> mytweet=("this is line1\n" "this is line2\n" "this is line3\n")>>> print mytweetthis is line1this is line2this is line3
It appears the direct editing of the default format variable in twitter.py is best.
Jan 2 13:05:16 stretch22 weewx[2871]: restx: Twitter: msg: Narangba Test - weeWX 3.8.0a test2 13:05 Jan 02 2018:\nT: 32.6C\nD: 27.2C\nW: N 0.0kph gusting to 0.0kph\nH: 80%\nP: 31.10hPa\nDay Rain {dayRain:%.2f}mm\nRain Rate: 0.0mm/hr\nChill:32.6C\nHIndex:32.6C\nSolar: 924W/m2\nUV: 13\n#PortAlberni\nhttps://www.alberniweather.ca\nhttps://www.youtube.com/alberniweather
Jan 2 12:55:16 stretch22 weewx[2744]: restx: Twitter: msg: Narangba Test 12:55 Jan 02 2018:#012T: 32.6C#012D: 27.1C#012W: N 0.0kph gusting to 0.0kph#012H: 80%#012P: 31.10hPa#012Day Rain {dayRain:%.2f}mm#012Rain Rate: 0.0mm/hr#012Chill:32.6C#012HIndex:32.6C#012Solar: 948W/m2#012UV: 13#012#PortAlberni#012https://www.alberniweather.ca#012https://www.youtube.com/alberniweather
if usn is not None:
site_dict['unit_system'] = weewx.units.unit_constants[usn]
loginf('units will be converted to %s' % usn)
try:
site_dict['format'] = site_dict['format'].replace('\\n','\n')
except:
pass
site_dict.setdefault('format', self._DEFAULT_FORMAT)
site_dict.setdefault('format_None', self._DEFAULT_FORMAT_NONE)
site_dict.setdefault('format_utc', False)
format = """{station} {dateTime:%H:%M %b %d %Y}:
T: {outTemp:%.1f}ºCD: {dewpoint:%.1f}ºC"""
--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.
Gary