     env = mutate_env(env)
     case fetch_resource(nil, pin_num) do
       %Peripheral{pin: pin_num, label: name} ->
-        do_read(env, pin_num, mode, label, name)
+        do_read(env, Peripheral, pin_num, mode, label, name)
+
       %Sensor{pin: pin_num, label: name} ->
-        do_read(env, pin_num, mode, label, name)
+        do_read(env, Sensor, pin_num, mode, label, name)
+
       {:ok, ^pin_num} ->
-        do_read(env, pin_num, mode, label, "Pin #{pin_num}")
+        do_read(env, nil, pin_num, mode, label, "Pin #{pin_num}")
+
       {:error, reason} -> {:error, reason, env}
     end
   end
 
-  defp do_read(env, pin_num, mode, label, msg) do
+  defp do_read(env, type, pin_num, mode, label, msg) do
     case Farmbot.Firmware.read_pin(pin_num, mode) do
       :ok ->
         case Farmbot.BotState.get_pin_value(pin_num) do
           {:ok, val} ->
+            maybe_http_side_effects(type, pin_num, mode, val)
             log_success(msg, pin_num, mode, val)
             Farmbot.CeleryScript.var(env, label, val)
           {:error, reason} -> {:error, reason, env}

  defp try_lookup_sensor(number) do
    Asset.get_sensor_by_number(number)
  end
end

    id = named_pin.args.pin_id
    type = named_pin.args.pin_type
    case fetch_resource(type, id) do
      %Peripheral{pin: pin_num, label: name} -> 
        do_read(env, Peripheral, pin_num, mode, label, name)

      %Sensor{pin: pin_num, label: name} -> 
        do_read(env, Sensor, pin_num, mode, label, name)

      {:error, reason} -> {:error, reason, env}
    end
  end
