Firebase REST Streaming vs HTTP REST


#1

Does anybody know why the Firebase REST returned fields are limited in comparison the the HTTP returned fields?

Have a few programs written in Ruby. One runs with an interface to Firebase and the other runs on top of a Ruby gem called HTTParty. The HTTP gem returns so much more NEST information in comparison to the Firebase REST interface.

Any ideas?

Thank you.


#2

are you using the same token for both connections? Can you post what url you are makig the requests too?

https://developer-api.nest.com will return a lot more information than https://developer-api.nest.com/devices will.

Can you give an example of what you’re seeing in HTTP that you’re not seeing in Firebase?


#3

The tokens are different. Even if I run Firebase at the “root” level, I still do not get information like the battery level, the schedules etc… The REST return structure is very different for each of the URL’s

It looks like the HTTP link is:

https://czfe26-front01-iad01.transport.home.nest.com

and firebase is:

https://firebase-apiserver08-tah01-iad01.dapi.production.nest.com:9553


#4

can you post the url you’re using for both connections and then an example return payload from each?


#5

It looks like the HTTP link is:

https://czfe26-front01-iad01.transport.home.nest.com

{
                    "tou" => {
        "0928150ENW" => {
              "$version" => -1,
            "$timestamp" => 1
        }
    },
      "user_alert_dialog" => {
        "2550942" => {
               "$version" => 5420,
             "$timestamp" => 1446309375806,
            "dialog_data" => "",
              "dialog_id" => "confirm-pairing"
        }
    },
                "buckets" => {
        "2550942" => {
              "$version" => 14433,
            "$timestamp" => 1476157643077,
               "buckets" => [
                [ 0] "device.",
                [ 1] "demand_response.",
                [ 2] "device_alert_dialog",
                [ 3] "link.",
                [ 4] "message.",
                [ 5] "metadata.",
                [ 6] "schedule.",
                [ 7] "shared.",
                [ 8] "track.",
                [ 9] "tuneups.0",
                [10] "energy_latest.",
                [11] "energy_weekly.",
                [12] "tou.",
                [13] "demand_charge",
                [14] "user.2550942",
                [15] "user_alert_dialog.2550942",
                [16] "message_center.2550942",
                [17] "user_settings.2550942",
                [18] "buckets.2550942",
                [19] "structure_history.",
                [20] "trip.05e1cda0-",
                [21] "structure_metadata.",
                [22] "safety.",
                [23] "safety_summary.",
                [24] "geofence_info.",
                [25] "structure.",
                [26] "where.",
                [27] "utility."
            ]
        }
    },
                  "track" => {
        "09AA" => {
                   "$version" => -13585,
                 "$timestamp" => 1477943733074,
                     "online" => true,
            "last_connection" => 1477943733074,
                    "last_ip" => ""
        }
    },
         "message_center" => {
        "2550942" => {
              "$version" => 25341,
            "$timestamp" => 1450978567904,
              "messages" => [
                [0] {
                            "id" => "",
                           "key" => "furnace_shutdown_alert",
                      "priority" => 2,
                     "timestamp" => 1450936645,
                     "thread_id" => 0,
                          "read" => true,
                     "dismissed" => true,
                    "parameters" => [
                        [0] "09",
                        [1] "",
                        [2] "The House",
                        [3] "00000000-0000-0000-0000-00010000000b",
                        [4] "Family Room"
                    ]
                }
            ]
        }
    },
                 "safety" => {
        "05" => {
                                "$version" => -17700,
                              "$timestamp" => 1446307450872,
            "audio_self_test_participants" => []
        }
    },
                "utility" => {
        "05" => {
              "$version" => -1,
            "$timestamp" => 1
        }
    },
                  "where" => {
        "05" => {
              "$version" => 13788,
            "$timestamp" => 1446307450748,
                "wheres" => [
                [ 0] {
                    "where_id" => "00000000-0000-0000-0000-000100000011",
                        "name" => "Backyard"
                },
                [ 1] {
                    "where_id" => "00000000-0000-0000-0000-000100000001",
                        "name" => "Basement"
                },
                [ 2] {
                    "where_id" => "00000000-0000-0000-0000-00010000000d",
                        "name" => "Bedroom"
                },
                [ 3] {
                    "where_id" => "00000000-0000-0000-0000-000100000003",
                        "name" => "Den"
                },
                [ 4] {
                    "where_id" => "00000000-0000-0000-0000-000100000010",
                        "name" => "Dining Room"
                },
                [ 5] {
                    "where_id" => "00000000-0000-0000-0000-000100000006",
                        "name" => "Downstairs"
                },
                [ 6] {
                    "where_id" => "00000000-0000-0000-0000-000100000012",
                        "name" => "Driveway"
                },
                [ 7] {
                    "where_id" => "00000000-0000-0000-0000-000100000000",
                        "name" => "Entryway"
                },
                [ 8] {
                    "where_id" => "00000000-0000-0000-0000-00010000000b",
                        "name" => "Family Room"
                },
                [ 9] {
                    "where_id" => "00000000-0000-0000-0000-000100000013",
                        "name" => "Front Yard"
                },
                [10] {
                    "where_id" => "00000000-0000-0000-0000-000100000002",
                        "name" => "Hallway"
                },
                [11] {
                    "where_id" => "00000000-0000-0000-0000-000100000008",
                        "name" => "Kids Room"
                },
                [12] {
                    "where_id" => "00000000-0000-0000-0000-00010000000a",
                        "name" => "Kitchen"
                },
                [13] {
                    "where_id" => "00000000-0000-0000-0000-00010000000c",
                        "name" => "Living Room"
                },
                [14] {
                    "where_id" => "00000000-0000-0000-0000-000100000005",
                        "name" => "Master Bedroom"
                },
                [15] {
                    "where_id" => "00000000-0000-0000-0000-00010000000e",
                        "name" => "Office"
                },
                [16] {
                    "where_id" => "00000000-0000-0000-0000-000100000014",
                        "name" => "Outside"
                },
                [17] {
                    "where_id" => "00000000-0000-0000-0000-00010000000f",
                        "name" => "Upstairs"
                }
            ]
        }
    },
              "structure" => {
        "05" => {
                                     "$version" => 13085,
                                   "$timestamp" => 1477868930612,
                                "creation_time" => 1446307450748,
             "topaz_enhanced_auto_away_enabled" => false,
                                  "tou_enabled" => true,
                                         "away" => true,
                                   "touched_by" => {
                "touched_by" => 1,
                "touched_id" => ""
            },
                        "demand_charge_enabled" => true,
                     "diamond_changed_location" => false,
                "tou_speedbump_count_remaining" => 3,
                                "vacation_mode" => false,
                              "num_thermostats" => "1",
                            "measurement_scale" => "imperial",
               "tou_speedbump_last_shown_epoch" => 0,
                                "address_lines" => [],
                   "eta_preconditioning_active" => false,
                        "manual_away_timestamp" => 1477529415,
                   "geofence_enhanced_autoaway" => {
                 "is_set" => true,
                "enabled" => false
            },
                                   "house_type" => "family",
                               "structure_area" => ,
                               "away_timestamp" => 1477529415,
                                  "away_setter" => 1,
                                    "time_zone" => "America/Los_Angeles",
                              "renovation_date" => "pre-1940",
                  "goose_sensor_events_enabled" => true,
                                 "country_code" => "US",
                                   "topaz_away" => false,
            "hvac_smoke_safety_shutoff_enabled" => false,
                          "dr_reminder_enabled" => true,
                  "hvac_safety_shutoff_enabled" => true,
                                         "name" => "The Creek House",
                               "topaz_hush_key" => "",
                                     "location" => "Fairfax, CA",
                                  "postal_code" => "94930",
                                         "user" => "user.",
                                      "devices" => [
                [0] "device.09"
            ],
                                        "swarm" => [
                [0] "device.09"
            ],
                                   "fabric_ids" => [],
                                     "clutches" => [],
                                      "members" => [
                [0] {
                     "user" => "user.2550942",
                    "roles" => [
                        [0] "owner"
                    ]
                }
            ]
        }
    },
                "message" => {
        "09" => {
              "$version" => 17003,
            "$timestamp" => 1446309379580
        }
    },
                "tuneups" => {
        "09" => {
              "$version" => -1,
            "$timestamp" => 1
        }
    },
                 "device" => {
        "09" => {
                                       "$version" => -27152,
                                     "$timestamp" => 1477857396701,
                              "temperature_scale" => "F",
                               "hot_water_active" => true,
                                 "time_to_target" => 0,
                                 "cooling_source" => "electric",
                              "alt_heat_delivery" => "forced-air",
                                 "leaf_away_high" => 28.87999,
                        "time_to_target_training" => "ready",
                              "upper_safety_temp" => 35.0,
                           "pin_star_description" => "none",
                             "pin_w1_description" => "heat",
                                    "has_x3_heat" => false,
                               "heat_x2_delivery" => "forced-air",
                              "dehumidifier_type" => "unknown",
                        "compressor_lockout_leaf" => -17.79999,
                     "sunlight_correction_active" => false,
                            "backplate_mono_info" => "TFE (BP_D3) 1.1.27 (root@sticks) 2016-05-12 11:16:41",
                                  "has_heat_pump" => false,
                        "hot_water_boiling_state" => true,
                      "temperature_lock_low_temp" => 20.0,
                                  "device_locale" => "en_US",
                                     "note_codes" => [],
                            "leaf_threshold_heat" => 16.67,
                           "dual_fuel_breakpoint" => -1.0,
                                 "nlclient_state" => "",
                        "schedule_learning_reset" => false,
                                 "has_humidifier" => false,
                   "learning_days_completed_cool" => 0,
                               "emer_heat_enable" => false,
                            "fan_cooling_enabled" => true,
                                "backplate_model" => "Backplate-5.3",
                                        "has_fan" => true,
                                   "has_aux_heat" => false,
                                           "rssi" => 79.0,
                   "away_temperature_low_enabled" => true,
                           "alt_heat_x2_delivery" => "forced-air",
                      "lower_safety_temp_enabled" => true,
                    "sunlight_correction_enabled" => true,
                                "heater_delivery" => "forced-air",
                                "alt_heat_source" => "gas",
                              "available_locales" => "en_US,fr_CA,es_US,en_GB,fr_FR,nl_NL",
                                   "range_enable" => false,
                                         "pro_id" => "",
                              "lower_safety_temp" => 4.44397,
              "humidity_control_lockout_end_time" => 0,
                        "filter_reminder_enabled" => true,
                                  "heater_source" => "gas",
                                 "heat_x3_source" => "gas",
                               "maint_band_lower" => 0.39,
                                 "equipment_type" => "electric",
                    "safety_temp_activating_hvac" => false,
                                    "is_on_stand" => false,
                  "learning_days_completed_range" => 0,
                               "auto_away_enable" => true,
                         "hot_water_away_enabled" => true,
                          "away_temperature_high" => 24.44444,
                                     "forced_air" => true,
                               "maint_band_upper" => 0.39,
                                     "hvac_wires" => "Heat,Fan,Common Wire,Rh",
                      "has_hot_water_temperature" => false,
                  "dual_fuel_breakpoint_override" => "none",
                            "fan_duty_start_time" => 0,
                     "hvac_safety_shutoff_active" => false,
                                   "country_code" => "US",
            "humidity_control_lockout_start_time" => 0,
                            "leaf_schedule_delta" => 1.10999,
                               "logging_priority" => "informational",
                             "demand_charge_icon" => false,
                                     "error_code" => "",
                          "fan_cooling_readiness" => "not ready",
                                 "heat_x2_source" => "gas",
                                  "learning_mode" => false,
                  "away_temperature_low_adjusted" => 7.674,
               "hvac_smoke_safety_shutoff_active" => false,
                               "current_humidity" => 75,
                                   "has_alt_heat" => false,
                                       "tou_icon" => false,
                                    "mac_address" => "18",
                      "upper_safety_temp_enabled" => false,
                               "auto_dehum_state" => false,
                         "backplate_mono_version" => "1.1.27",
                        "heatpump_setback_active" => false,
                              "fan_cooling_state" => false,
                         "target_time_confidence" => 0.0,
                          "has_hot_water_control" => false,
                             "pin_rc_description" => "none",
                   "learning_days_completed_heat" => 47,
                        "preconditioning_enabled" => false,
                                      "star_type" => "unknown",
                                "aux_heat_source" => "electric",
                                  "creation_time" => 1446251639955,
                            "filter_changed_date" => 0,
                                    "has_x2_heat" => false,
                                     "touched_by" => {},
                                  "has_emer_heat" => false,
                "heat_pump_aux_threshold_enabled" => true,
                          "hot_water_away_active" => false,
                         "preconditioning_active" => false,
                                           "type" => "TBD",
                               "aux_lockout_leaf" => 10.0,
                            "oob_wires_completed" => true,
                      "temperature_lock_pin_hash" => "",
                                 "ob_orientation" => "O",
                                 "ob_persistence" => true,
                            "is_furnace_shutdown" => false,
                                  "leaf_away_low" => 10.0,
                                 "learning_state" => "slow",
                        "should_wake_on_approach" => true,
                                  "has_dual_fuel" => false,
                            "gear_threshold_high" => 0.0,
                                "has_x2_alt_heat" => false,
                               "humidifier_state" => false,
                                       "local_ip" => "192",
                               "heatpump_savings" => "off",
                        "oob_interview_completed" => true,
                        "backplate_serial_number" => "09",
                                 "fan_duty_cycle" => 3600,
                            "oob_where_completed" => true,
                        "target_humidity_enabled" => false,
                                  "model_version" => "Display-3.4",
                 "away_temperature_high_adjusted" => 24.44444,
                       "heat_pump_comp_threshold" => -31.5,
                             "oob_temp_completed" => true,
              "dehumidifier_orientation_selected" => "unknown",
                                "auto_away_reset" => false,
                             "oob_test_completed" => true,
                                       "fan_mode" => "auto",
                          "current_schedule_mode" => "HEAT",
                             "pin_y1_description" => "none",
                     "temperature_lock_high_temp" => 22.222,
                               "heat_x3_delivery" => "forced-air",
                               "cooling_delivery" => "unknown",
                          "oob_summary_completed" => true,
                          "filter_reminder_level" => 0,
                                  "battery_level" => 3.935,
                               "has_dehumidifier" => false,
                                  "serial_number" => "09",
                                           "leaf" => true,
                              "safety_state_time" => 0,
                              "pin_g_description" => "fan",
                               "temperature_lock" => false,
                                       "where_id" => "00000000-0000-0000-0000-000100000008",
                              "cooling_x2_source" => "electric",
                                "humidifier_type" => "unknown",
                  "last_software_update_utc_secs" => 1470131168,
                                "user_brightness" => "medium",
                                        "y2_type" => "unknown",
                        "smoke_shutoff_supported" => true,
                             "pin_ob_description" => "none",
                                "target_humidity" => 35.0,
                                    "postal_code" => "94930",
                              "pin_c_description" => "power",
                             "alt_heat_x2_source" => "gas",
               "heat_pump_comp_threshold_enabled" => false,
                             "gear_threshold_low" => 0.0,
                  "away_temperature_high_enabled" => false,
                            "leaf_threshold_cool" => 0.0,
                                      "hvac_pins" => "W1,C,Rh,G",
                             "auto_dehum_enabled" => false,
                             "pin_y2_description" => "none",
                              "fan_control_state" => false,
                             "backplate_bsl_info" => "BSL",
                        "radiant_control_enabled" => false,
                                 "heatpump_ready" => false,
                               "capability_level" => 5.51,
                             "dehumidifier_state" => false,
                              "fan_duty_end_time" => 0,
                           "away_temperature_low" => 7.674,
                          "preconditioning_ready" => true,
                                    "has_x2_cool" => false,
                        "heat_pump_aux_threshold" => 10.0,
                              "aux_heat_delivery" => "forced-air",
                                "farsight_screen" => "analog_clock",
                             "oob_wifi_completed" => true,
                        "filter_changed_set_date" => 0,
                                "has_fossil_fuel" => true,
                             "emer_heat_delivery" => "forced-air",
                                  "learning_time" => 1009,
                      "sunlight_correction_ready" => true,
                            "cooling_x2_delivery" => "unknown",
                                 "has_air_filter" => true,
                                   "safety_state" => "none",
               "humidity_control_lockout_enabled" => false,
                          "backplate_bsl_version" => "3.1",
                           "heat_link_connection" => 0,
                          "oob_startup_completed" => true,
                             "pin_rh_description" => "power",
                                "current_version" => "5.5.1-6",
                                    "click_sound" => "on",
                              "switch_system_off" => false,
                              "fan_timer_timeout" => 0,
                             "fan_timer_duration" => 900,
                               "emer_heat_source" => "electric",
                          "pin_w2aux_description" => "none",
                                      "schedules" => []
        }
    },
                   "trip" => {
        "05" => {
              "$version" => 30965,
            "$timestamp" => 1446307450872,
                 "trips" => []
        }
    },
        "demand_response" => {
        "09" => {
              "$version" => -1,
            "$timestamp" => 1
        }
    },
                   "user" => {
        "2550942" => {
                         "$version" => -22219,
                       "$timestamp" => 1447312165363,
                            "email" => "@gmail.com",
                             "name" => "@gmail.com",
                "profile_image_url" => "https://home.nest.com",
                       "short_name" => "Oscar",
                       "structures" => [
                [0] "structure.05"
            ],
            "structure_memberships" => [
                [0] {
                    "structure" => "structure.05",
                        "roles" => [
                        [0] "owner"
                    ]
                }
            ]
        }
    },
                   "link" => {
        "09" => {
              "$version" => -28016,
            "$timestamp" => 1446309375806,
             "structure" => "structure.05"
        }
    },
    "device_alert_dialog" => {
        "09AA01AC28150ENW" => {
               "$version" => -29304,
             "$timestamp" => 1446309375806,
            "dialog_data" => "",
              "dialog_id" => "confirm-pairing"
        }
    },
          "geofence_info" => {
        "05" => {
                 "$version" => -16775,
               "$timestamp" => 1446307450872,
            "device_events" => [],
                   "fences" => []
        }
    },
               "metadata" => {
        "09" => {
                   "$version" => -1,
                 "$timestamp" => 1356998400000,
                    "last_ip" => "127.0.0.1",
            "last_connection" => 1356998400000
        }
    },
          "user_settings" => {
        "2550942" => {
                                     "$version" => -21663,
                                   "$timestamp" => 1457742636313,
                               "email_verified" => true,
                         "tos_accepted_version" => 1434564000001,
                     "receive_marketing_emails" => true,
                          "receive_nest_emails" => true,
                       "receive_support_emails" => true,
                               "max_structures" => 2,
                              "max_thermostats" => 40,
                "max_thermostats_per_structure" => 20,
            "max_smoke_detectors_per_structure" => 18,
                          "max_smoke_detectors" => 36,
                "max_wwn_devices_per_structure" => 10,
                              "max_wwn_devices" => 20,
                          "tos_minimum_version" => 1434564000001,
                          "tos_current_version" => 1434564000001,
                      "app_swu_minimum_version" => {
                "pairing" => 2
            },
                                         "lang" => "en_US",
                         "has_location_history" => false
        }
    },
          "demand_charge" => {
        "09" => {
              "$version" => -1,
            "$timestamp" => 1
        }
    },
     "structure_metadata" => {
        "05" => {
              "$version" => -22891,
            "$timestamp" => 1446307450872
        }
    },
                 "shared" => {
        "09" => {
                              "$version" => 5143,
                            "$timestamp" => 1477935545455,
                    "hvac_heat_x2_state" => false,
                             "auto_away" => 1,
                            "touched_by" => {},
                "hvac_alt_heat_x2_state" => false,
                    "target_temperature" => 10.0,
                 "target_change_pending" => false,
            "compressor_lockout_enabled" => false,
            "compressor_lockout_timeout" => 0,
                              "can_heat" => true,
                   "hvac_alt_heat_state" => false,
                   "current_temperature" => 14.73999,
                         "hvac_ac_state" => false,
                  "hvac_emer_heat_state" => false,
                    "hvac_cool_x2_state" => false,
               "target_temperature_type" => "heat",
                              "can_cool" => false,
                     "hvac_heater_state" => false,
                                  "name" => "Lakeshore Drive",
                    "hvac_heat_x3_state" => false,
                 "hvac_aux_heater_state" => false,
               "target_temperature_high" => 24.0,
                    "auto_away_learning" => "ready",
                        "hvac_fan_state" => false,
                "target_temperature_low" => 20.0
        }
    },
               "schedule" => {

#6

Firebase Link:

{
  "devices": {
    "thermostats": {
      "r": {
        "humidity": 75,
        "locale": "en-US",
        "temperature_scale": "F",
        "is_using_emergency_heat": false,
        "has_fan": true,
        "software_version": "5.6-7",
        "has_leaf": true,
        "where_id": "",
        "device_id": "",
        "name": "Kids Room (Lakeshore Drive)",
        "can_heat": true,
        "can_cool": false,
        "target_temperature_c": 10,
        "target_temperature_f": 50,
        "target_temperature_high_c": 24,
        "target_temperature_high_f": 75,
        "target_temperature_low_c": 20,
        "target_temperature_low_f": 68,
        "ambient_temperature_c": 14.5,
        "ambient_temperature_f": 59,
        "away_temperature_high_c": 24,
        "away_temperature_high_f": 76,
        "away_temperature_low_c": 7.5,
        "away_temperature_low_f": 46,
        "structure_id": "",
        "fan_timer_active": false,
        "fan_timer_timeout": "1970-01-01T00:00:00.000Z",
        "hvac_mode": "eco",
        "name_long": "Kids Room Thermostat (Lakeshore Drive)",
        "is_online": true,
        "last_connection": "2016-11-01T16:46:46.530Z",
        "hvac_state": "off"
      }
    }
  },
  "structures": {
    "": {
      "name": "The House",
      "country_code": "US",
      "time_zone": "America/Los_Angeles",
      "away": "auto-away",
      "thermostats": [
        ""
      ],
      "structure_id": "",
      "wheres": {
        "": {
          "where_id": "",
          "name": "Backyard"
        },
        "": {
          "where_id": "",
          "name": "Basement"
        },
        "": {
          "where_id": "",
          "name": "Bedroom"
        },
        "": {
          "where_id": "",
          "name": "Den"
        },
        "": {
          "where_id": "",
          "name": "Dining Room"
        },
        "": {
          "where_id": "",
          "name": "Downstairs"
        },
        "": {
          "where_id": "",
          "name": "Driveway"
        },
        "": {
          "where_id": "",
          "name": "Entryway"
        },
        "": {
          "where_id": "",
          "name": "Family Room"
        },
        "": {
          "where_id": "",
          "name": "Front Yard"
        },
        "": {
          "where_id": "",
          "name": "Hallway"
        },
        "": {
          "where_id": "",
          "name": "Kids Room"
        },
        ": {
          "where_id": "",
          "name": "Kitchen"
        },
        "": {
          "where_id": "",
          "name": "Living Room"
        },
        "": {
          "where_id": "",
          "name": "Master Bedroom"
        },
        ": {
          "where_id": "",
          "name": "Office"
        },
        "": {
          "where_id": "",
          "name": "Outside"
        },
        "": {
          "where_id": "",
          "name": "Upstairs"
        }
      }
    }
  },
  "metadata": {
    "access_token": "",
    "client_version": 1
  }
}

#7

Are you sure you are using the official API for your HTTP request? Using the URL https://developer-api.nest.com


#8

Regarding the comment above, referencing the HTTP link:

https://czfe26-front01-iad01.transport.home.nest.com

This is not the official Nest API and is not used for integrations.


#9

anyway, it would be great to have the mac or ip address in the official API